IBOutlet未显示在文件所有者/ IB中

时间:2011-09-28 10:52:48

标签: iphone objective-c xcode4 interface-builder iboutlet

在我的.h文件中,我有这个:

@interface {
UILabel *questionLabel_;
}

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

在我的.mm文件中,我有这个:

@synthesize questionLabel = questionLabel_;

当我转到xib文件时,我在文件所有者中看不到questionLabel的证据。我也无法通过ctrl拖动到文件所有者或第一响应者来连接UILabel。

虽然使用了我创建的两个UIButton。

想法?

1 个答案:

答案 0 :(得分:5)

您应该为File's Owner.

设置适当的等级

打开Utilities -> Identity Inspector -> Custom Class -> Class -> Select your class

之后,您将可以设置插座。

相关问题