tableview在ios8上有数据 ios7上无数据显示的奇怪问题
往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,倒是都是有数据显示
有谁知道这是为啥吗?