为什么TableView 的代理方法cellForRowAtIn

作者: LeeCen | 来源:发表于2016-03-03 16:05 被阅读554次

检查一下

  • 这个方法如果返回值为 0 或 nil 就不会执行 cellForRowAtIndexPath 方法
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 0; 
    或
    return nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell ····

    return cell;
}

相关文章

网友评论

  • 点柈:行都没有了,cell设置了有啥用啊
    点柈:@点柈 嗯啊
    LeeCen:@点柈 正是没有,所有才不行 cell 的方法嘛
  • 05928c0c7c63:哈哈,这是设置表单 区的个数,没有当然不知行了
    LeeCen:@樱空释的爱1 嗯嗯

本文标题:为什么TableView 的代理方法cellForRowAtIn

本文链接:https://www.haomeiwen.com/subject/jvxokttx.html