tableview在ios8上有数据 ios7上无数据显示的奇怪问题

yuechuan 2015-01-16 03:42:49
往uiviewcontroller上面放一个 tableview

代码如下
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{


return 10;

}



-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *TableSampleIdentifier = @"TableSampleIdentifier";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
TableSampleIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:TableSampleIdentifier];
}

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;


cell.textLabel.text = @"demo";



return cell;


}

在iOS8上面一切正常,看到10个 demo字样,但是在iOS7上面却是白板一片

然后尝试直接使用 tableviewcontroller,倒是都是有数据显示

有谁知道这是为啥吗?
...全文
135 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuechuan 2015-01-19
  • 打赏
  • 举报
回复
有进入numberOfRowsInSection,没有进入cellforrow。。。
qqqwww198273 2015-01-18
  • 打赏
  • 举报
回复
在ios7下,调试是否进入了cellforrow方法。 如果确认进入了。。。无耻点,直接把你的tableview加到window上看看
yuechuan 2015-01-16
  • 打赏
  • 举报
回复
没人知道吗?自己顶!

29,031

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧