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
本文详细介绍如何从零开始创建一个iOS应用程序并配置启动流程。通过新建EmptyApplication项目、MainWindow.xib文件,设置File'sOwner和DemoAppDelegate,连接delegate及window属性,放置UI元素,最后设置项目入口实现应用启动。
1565

被折叠的 条评论
为什么被折叠?



