Search code examples
iphoneobjective-cxcode4interface-builderiboutlet

IBOutlet not showing in File's Owner/ IB


In my .h file I have this:

@interface {
UILabel *questionLabel_;
}

@property (nonatomic, retain) IBOutlet UILabel *questionLabel;

In my .mm file I have this:

@synthesize questionLabel = questionLabel_;

When I go to the xib file I see no evidence of questionLabel in the File Owner. Nor can I connect a UILabel by ctrl dragging to File Owner or First Responder.

It is though working with two UIButtons I have created.

Ideas?


Solution

  • You should set appropriate class of your File's Owner.

    Open Utilities -> Identity Inspector -> Custom Class -> Class -> Select your class.

    After that you will be able to set outlets.