storyBoard(tableViewl)

 1 #import "CustomerTableViewController.h"
 2 #import "CustomerTableViewCell.h"
 3 @interface CustomerTableViewController ()
 4 
 5 @end
 6 
 7 @implementation CustomerTableViewController
 8 
 9 - (void)viewDidLoad {
10     [super viewDidLoad];
11     /*
12      1.在storyBoard中拖一个UITableViewController
13      2.自定义cell:在contentView处于选中状态,然后往里边添加控件
14      3.创建与之关联的类,并创建与自定义cell关联的UITableViewCell
15      4.在storyBoard中选中tableViewCell并设置reuseidentifier
16      5.修改外部与storyBoard关联的CustomerViewController,设置行数和区数,然后从重用池里取相应的cell,此时注意cell的重用标识和storyBoard中设置的重用标识保持一致
17      6.使用storyBoard不用自定义cell
18      */
19 }
20 
21 - (void)didReceiveMemoryWarning {
22     [super didReceiveMemoryWarning];
23     // Dispose of any resources that can be recreated.
24 }
25 
26 #pragma mark - Table view data source
27 
28 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
29 #warning Incomplete implementation, return the number of sections
30     return 1;
31 }
32 
33 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
34 #warning Incomplete implementation, return the number of rows
35     return 10;
36 }
37 
38 
39 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
40     CustomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomerTableViewCell" forIndexPath:indexPath];
41     
42     // Configure the cell...
43     
44     return cell;
45 }
46 
47 
48 
49 @end

 

posted @ 2016-03-06 10:31  恒远也  阅读(400)  评论(0编辑  收藏  举报