现在的位置: 首页 > 综合 > 正文

UITableView 常用的几个方法

2017年12月09日 ⁄ 综合 ⁄ 共 657字 ⁄ 字号 评论关闭

- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {

    

   
return
1;

    

}


- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    

   
return
1;

    

}


- (UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    

   
static
NSString *Identifier = @"Cell";

   
UITableViewCell *cell       = [tableView dequeueReusableCellWithIdentifier:Identifier];

   
if
(cell == nil) {

        cell = [[[UITableViewCell
alloc]initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:Identifier] autorelease];

    }

    

    

    

   
return
cell;

    

}


- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    

    

}

抱歉!评论已关闭.