iOS之segue控制导航的使用

来源:互联网 发布:淘宝网店宝贝描述模板 编辑:程序博客网 时间:2024/06/06 02:42

1、FKBookListController类

#import "FKBookListController.h"@interface FKBookListController ()@end@implementation FKBookListControllerNSArray* books;- (void)viewDidLoad{[super viewDidLoad];books = [NSArray arrayWithObjects:@"疯狂Android讲义",@"疯狂iOS讲义", @"疯狂Ajax讲义" , @"疯狂XML讲义", nil];}- (NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section{    return books.count;}- (UITableViewCell *)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath *)indexPath{// 获取行号NSInteger rowNo = indexPath.row;// 根据identifier获取表格行UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"bookCell" forIndexPath:indexPath];// 获取cell内包含的Tag为1的UILabelcell.textLabel.text = [books objectAtIndex:rowNo];return cell;}@end

1、首先添加情况工程自带的View控件,并添加UINavigationController,包括UINavigationController和UITableViewController

2、将UITableViewController中的表格设置为静态表格,包括2行

3、添加一个UIViewController和一个UITableViewController分别segue静态表格的两个对象,选择AccessoryAction的push类型

有些属性在XCode上设置,具体参考《疯狂iOS讲义上》P489

0 0
原创粉丝点击