当解析本地 XML 文件时,我可以使用 NSLog 在控制台中看到数据。在模拟器中,我只获得了没有从 xml 解析的任何数据的普通 TableView 。我不明白我在哪里遗漏了它。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
theLists = [app.listArray objectAtIndex:indexPath.row];
cell.textLabel.text = theLists.title;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
最佳答案
我认为您没有重新加载表格 View 。 完成解析后,只需重新加载表格 View 即可。
[重新加载表名];
然后检查您的 TableView 委托(delegate)是否在此方法之后调用。 我认为这会对您有所帮助。
快乐编码。
关于ios - 为什么表格 View 不显示 iphone 中的任何数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13491727/