![](/img/trans.png)
[英]Custom class with prefix not showing up in custom class combo box in Interface Builder
[英]Interface Builder - custom class not showing
我是使用Mac OS X 10.8.5和Xcode 5的iOS开发人员。我试图使我的iPhone应用程序通用,但是viewController的对象(例如按钮,文本视图等)无法连接到viewController的类。 我尝试将自定义类添加到viewController,但是自定义类会自动返回到UIViewController(是的,我检查了该类的拼写)。 自定义类适用于我的iPhone故事板上,但不适用于我的iPad故事板上。 我还尝试重新启动Xcode甚至我的iMac,到目前为止还没有用。
这是我班的代码(.h文件):
@interface hackScreen : UIView
@property (retain, nonatomic) IBOutlet UITextView *txtfieldOne;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldTwo;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldThree;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldFour;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldFive;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldSix;
@property (retain, nonatomic) IBOutlet UITextView *txtfieldSeven;
@property (retain, nonatomic) IBOutlet UITextView *DatRandomBinary;
@property (retain, nonatomic) IBOutlet UITextView *leDoneMessage;
- (IBAction)tallStar:(id)sender;
- (void) oneStar;
- (void) tigerStar;
- (void) blackStar;
- (void) pineStar;
- (void) blueStar;
- (void) redStar;
- (void) cloudStar;
- (void) assemblyCode;
- (void) assemblyTwo;
- (void) radioActive;
@end
这是我的viewController身份检查器的图片:
您的hackscreen
类是UIView
的子类,而不是UIViewController
的子类。
将UIView放到xib,将她的班级设置为您的班级,然后转到viewController出口,在viewController的“视图”字段和放置的视图之间建立关系。
请更换:
@interface hackScreen : UIView
至
@interface hackScreen : UIViewController
您的hackScreen类必须是UIViewController的子类,才能显示在检查器中。 因此,您只需要将hackScreen类更改为UIViewController的子类,而不是UIView。
例如
@interface hackScreen:UIViewController
...
@结束
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.