【发布时间】:2012-12-30 19:43:29
【问题描述】:
我正在做我的第一个 iOS 应用程序,它应该类似于以下屏幕截图:
然而,根据我在 Xcode 中的项目截图,我似乎缺少一些连接,例如“窗口”和“代表”作为“文件的所有者”:
我正在关注 iOS 编程这本书 - 大书呆子牧场指南,由于这本书使用的是旧版本的 XCode -4.2,我想 - 我想我的问题与此有关。
谁能帮我找出如何创建那些缺失的连接?
如何将 window 添加到 Outlets 部分中的 Window 并将 delegate 添加到 Referencing Outlets 部分中的 File's Owner 中?
我真的需要添加它们吗?
提前非常感谢!
编辑:这是我的头文件:
#import <UIKit/UIKit.h>
@interface QuizAppDelegate : UIResponder <UIApplicationDelegate>
{
int currentQuestionIndex;
// The model objects
NSMutableArray *questions;
NSMutableArray *answers;
// The view objects
IBOutlet UILabel *questionField;
IBOutlet UILabel *answerField;
}
@property (strong, nonatomic) UIWindow *window;
- (IBAction)showQuestion:(id)sender;
- (IBAction)showAnswer:(id)sender;
@end
【问题讨论】:
-
xcodes 版本和管理方式有差异。从引用出口拖动到对象..它将创建它。
标签: objective-c ios xcode4.2 xcode4.5 outlet