IOS cellForRowAtIndexPath方法不被调用
来源:互联网 发布:python绝技 代码 下载 编辑:程序博客网 时间:2024/06/07 02:30
问题:
第一次进入可以调用,创建新的cell。
从别的view跳转回来,就不在创建新的cell,不调用方法cellForRowAtIndexPath
@interface ScheduleTableViewController :UITableViewController
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *customCellIndentifier =@"CustomCellIndentifier";
UITableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:customCellIndentifier];
//定义新的cell
if(cell ==nil){
//使用默认的UITableViewCell,但是不使用默认的image与text,改为添加自定义的控件
cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:customCellIndentifier];
}
return cell;
}
解决方法:
- (void)viewDidLoad {
[superviewDidLoad];
//添加:
self.tableView.delegate =self;
self.tableView.dataSource =self;
//cell显示不完整
self.edgesForExtendedLayout =UIRectEdgeNone;
[selfviewWillAppear:YES];
}
-(void)viewWillAppear:(BOOL)animated{
[superviewWillAppear:animated];
self.automaticallyAdjustsScrollViewInsets =NO;
//每次进入此页面都需要从数据库中读取数据显示在tableView
self.listData=[NSMutableArrayarrayWithArray:[ScheduleDAOgetScheduleList]];
//添加
[self.tableViewreloadData];
}
- IOS cellForRowAtIndexPath方法不被调用
- iOS-UITableViewController-cellForRowAtIndexPath不被调用
- 为什么cellForRowAtIndexPath方法不调用?
- iOS cellForRowAtIndexPath 不调用原因分析
- tableView调用reloadData不刷新, cellForRowAtIndexPath方法不走
- ios UITableView的cellForRowAtIndexPath方法不执行的原因
- tableview cellForRowAtIndexPath reloadData不调用问题
- UITableView的cellForRowAtIndexPath方法被不必要的调用很多次的问题
- 为什么TableView 的代理方法cellForRowAtIndexPath 不执行问题
- 关于tableView的cellForRowAtIndexPath方法不走的一个解决办法
- cellForRowAtIndexPath不执行
- cellForRowAtIndexPath不执行
- cellForRowAtIndexPath不执行
- tableView cellforrowatindexpath 方法不掉用
- iOS viewcontroller中的dealloc方法不调用
- tableView代理方法的调用时间,(主要是heightForRowAtIndexPath和cellForRowAtIndexPath调用时间)
- cellForRowAtIndexPath
- UITableView不掉用tableView: cellForRowAtIndexPath方法
- Laravel 下配置 Redis Session
- linux 网络编程---域名解析
- 解决BASE64Encoder类在Eclipse中无法使用问题
- Proguard指南
- TCP标志位-续(RST)
- IOS cellForRowAtIndexPath方法不被调用
- css---border属性实现小三角型
- MVC5 + EF6 入门完整教程二
- dbms_rowid包
- jave获取视频时长
- 01背包
- php基础知识 1,php初涉
- 显示相应的系统窗口(设置、WIFI、拨号界面···)
- android 性能、内存优化