views:

221

answers:

1

Hi,

I have defined an objective-c protocol that declares a method that is tagged with IBAction. I implemented a UIViewController that implements the protocol.

In Interface Builder I created a nib file with the UIViewController as the file's owner. However the protocol method is not visible under the Received Actions section although it is tagged as IBAction.

I assume that protocol methods are not visible in Interface Builder. Is that correct? Thanks.

+2  A: 

IBAction is only a #define statement; this tag is not inherited when you implement a protocol.

You need to explicitly mark the implemented methods in your class with IBAction so Interface builder can pick them up when parsing the header file.

Laurent Etiemble