StoryBoard是iOS 5的新特征,目的是代替历史悠久的NIB/XIB,对于已经习惯了xib文件的孩子们来说,StoryBoard还不是那么熟悉。经过两天的研究,有了一些心得,在此分享。
一、如何使用storyboard简单实现Push页面,步骤如下:
1、创建一个带有storyboard的singleview application应用程序如图。
创建好的应用程序已经自动创建好了一个和MainStoryboard连接好的ViewController。
2、在MainStoryboard中,选中ViewController并拖入tableview以及tableviewCell,并且设置tableviewCell的style为Basic,Identifier为Cell,如果希望是自定义cell的则需要选择custom,如下图,之后可以插入一个NavigationController:
不要忘记连接datasource和delegate。
现在可以编码了,在ViewController.m中:
#pragmamark - UITableViewDataSource
-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section{
return1