iOS开发之 Xcode6 添加xib文件,去掉storyboard的hello world应用

iOS开发之  Xcode6.1创建仅xib文件,无storyboard的hello world应用

 

由于Xcode6之后,默认创建storyboard而非xib文件,而作为初学,了解xib的加载原理很重要,所以,需要创建一个没有storyboard的项目

1. 创建一个新的工程

2. 选择仅一个视图的模板

 选择 Single View Application , 点击Next

3. 删除storyboardlaunchscreen.xib文件

将storyboard和launchscreen扔进废纸篓

 

5. 修改info.plist文件

删除info.plist文件中Main storyboard file base name和Launch screen interface file base name两个属性

 

6. 创建user interface的视图xib文件

点击next,然后Save as “HelloWorldView”点击Create

7. 修改视图控制器文件

创建视图和控制器的关联,Xcode默认创建了ViewController.h和ViewController.m文件,所以就不用自己创建了

1)修改xib视图文件的File‘s Owner

点击列表中的File‘s Owner,按command+option+3 打开 Identity Inspector,修改Custom Class中的Class为ViewController

 

posted @ 2015-04-29 11:30  沐雨十方07  阅读(783)  评论(0编辑  收藏  举报