1、新建Empty Application项目,
2、新建文件MainWindow.xib
3、在MainWindow.xib中,File's Owner的Class设为UIApplication,拖出一个Object到dock上,并将其Class设为DemoAppDelegate
4、DemoAppDelegate.h
@interface DemoAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) IBOutlet UIWindow *window; @end
注意IBOutlet
5、选中File's Owner,在Connection面板中,将delegate拖到dock上的Demo App Delegate上
6、选中Demo App Delegate,在Connection面板中,将window拖到dock上的window上
Add{ 如果Dock 上是View,先把它的class改为UIWindow}
7、在window上放一个label
8、选中Demo项目,在Summary的Main Interface 中输入MainWindow
9、运行
参考:http://blog.sina.com.cn/s/blog_4f1d20f30100twtd.html