zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    泛型
    HTTP和HTTPS
    计算机网络(三)应用层
    练习38-操作列表
    第27讲:集合—在我的世界里,你就是唯一
    第25~26讲:字典:当索引不好用时
    第1~2讲:数据结构和算法绪论
    第23~24讲:这帮小兔崽子(斐波那契数列)和汉诺塔游戏
    练习36--设计和调试
    001-定义电子日历类
  • 原文地址:https://www.cnblogs.com/DevinSMR/p/5246689.html
Copyright © 2011-2022 走看看