0

我是使用 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 的身份检查器的图片: viewController 身份检查器

4

4 回答 4

0

请更换:

     @interface hackScreen : UIView

     @interface hackScreen : UIViewController
于 2013-10-14T09:24:47.967 回答
0

hackscreen的类是UIViewnot of的子类UIViewController

于 2013-10-14T02:54:16.940 回答
0

将 UIView 拖放到 xib,将她的类设置为您的类,然后转到 viewController 插座并在 viewController 的“视图”字段和删除的视图之间建立关系。

于 2013-10-14T04:29:46.527 回答
-1

您的 hackScreen 类需要是 UIViewController 的子类才能显示在检查器中。所以你只需要将 hackScreen 类更改为 UIViewController 的子类,而不是 UIView。

例如

@interface hackScreen : UIViewController

...

@结尾

于 2013-10-14T04:27:06.517 回答