开发者

Can't get the methods at interface builder

开发者 https://www.devze.com 2023-01-26 17:55 出处:网络
I declared one method in sample.h and implemented in sample.m . Now i want to perform one action through connecting to a button and that method. but the files owner doesn\'t show any of my methods. 开

I declared one method in sample.h and implemented in sample.m . Now i want to perform one action through connecting to a button and that method. but the files owner doesn't show any of my methods. 开发者_如何学JAVAWhats the problem.. Can anyone help me. i am new to this.

Thanks in Advance.


Have you specified that the File's Owner is of type sample? You can do that on the Identity tab in Interface Builder.

If sample is not a subclass of UIViewController you would most likely add an NSObject in Interface Builder and then set the Type to sample. You would also most likely have to add an IBOutlet to your view controller/File's Owner of type sample and connect it to the sample object in IB.


You want to make a function called on button press event.

so declare method in .h file as -(IBAction) click:(id)sender

then it shows in file's owner inspector.Make connection with button for touchUpInside.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号