kumar
kumar

Reputation: 1

Can't get the methods at interface builder

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. Whats the problem.. Can anyone help me. i am new to this.

Thanks in Advance.

Upvotes: 0

Views: 99

Answers (2)

Ishu
Ishu

Reputation: 12787

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.

Upvotes: 0

Robert Höglund
Robert Höglund

Reputation: 10080

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.

Upvotes: 1

Related Questions