从Empty Application到Window Based Application
2014-06-19 15:29
323 查看
1.创建Empty application,此时项目中只有一个AppDelegate的类
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png)
2.新建文件,选择User Interface下的Empty 命名为MainWindow
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png)
3.打开新建的MainWindow.xib文件
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png)
4.将File's Owner的类名修改为UIApplication
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png)
5. 在Library中拖放一个Object到图下的位置
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png)
6.将该object的类名修改为文件中AppDelegate的类名(同时还可以给object命名下Label)
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png)
7.拖放一个Window到左边
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png)
8. 在xAppDelegate的h文件中,给window的属性加上IBOutlet
9.将File's Owner 和 拖放的Object按照以下方式连接
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png)
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png)
10.在项目属性中,把Main Interface修改成你的xib文件名MainWindow
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png)
11. 在xAppDelegate.m文件中,将
这个方法全部注释掉
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-1.png)
2.新建文件,选择User Interface下的Empty 命名为MainWindow
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-2.png)
3.打开新建的MainWindow.xib文件
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-3.png)
4.将File's Owner的类名修改为UIApplication
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-4.png)
5. 在Library中拖放一个Object到图下的位置
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-5.png)
6.将该object的类名修改为文件中AppDelegate的类名(同时还可以给object命名下Label)
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-6.png)
7.拖放一个Window到左边
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-7.png)
8. 在xAppDelegate的h文件中,给window的属性加上IBOutlet
@interface DemoAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) IBOutlet UIWindow *window; @end
9.将File's Owner 和 拖放的Object按照以下方式连接
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-8.png)
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-9.png)
10.在项目属性中,把Main Interface修改成你的xib文件名MainWindow
![](http://www.trappers.tk/site/wp-content/uploads/2011/06/Step-11.png)
11. 在xAppDelegate.m文件中,将
- (BOOL) application:didFinishLaunchingWithOptions:
这个方法全部注释掉
相关文章推荐
- 如何在 Xcode 4.2 之后建立WindowBased Application
- XCode4.2中使用Empty Application模板替代旧的Window Based Application
- Xcode建立Window based Application
- XCode4.2中使用Empty Application模板替代旧的Window Based Application
- XCode4.2中使用Empty Application模板替代旧的Window Based Application
- xcode4.3 中Storyborad 替代了window based application
- XCode4.2中使用Empty Application模板替代旧的Window Based Application
- diffrence between [[[[UIApplication sharedApplication] delegate] window] and [[UIApplication sharedA
- Android酱油笔记之关于AlertDialog的Unable to add window token null is not for an application解决办法
- A dynamic niching clustering algorithm based on individual-connectedness and its application to colo
- xcode4.2新建Window_Base_Application的方法 英文版 按照书上做demo的有福了(很简单)
- How to add MFC Common class into your application based on SDK?
- window.applicationCache事件,介绍
- Vue component-based application structure
- Android错误--Attempted to add application window with unknown token
- Dialog(四)——报错Unable to add window -- token null is not for an application
- How to access UI controls from a user defined class (CFormView based SDI application)
- Browser-based desktop application development with java
- Application Based on .Net Framework, 如何保护我的代码?
- 创建对话框出现Unable to add window -- token null is not for an application问题