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

Eri*_*tto 1 iphone objective-c interface-builder iboutlet xcode4

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

@interface {
UILabel *questionLabel_;
}

@property (nonatomic, retain) IBOutlet UILabel *questionLabel;
Run Code Online (Sandbox Code Playgroud)

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

@synthesize questionLabel = questionLabel_;
Run Code Online (Sandbox Code Playgroud)

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

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

想法?

Nek*_*kto 5

你应该设置适当的类 File's Owner.

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

之后,您将能够设置插座.