コア データを使用してエンティティを取得しています。これらの結果がテーブルビューの 2 番目のセクションに表示され、別のセクションに何かが表示されるようにしたいだけです...アプリはクラッシュしていませんが、フェッチされたデータがテーブルビューに表示されません...私も確信していますデータを正しく取得しています。
ここにいくつかのコードがあります。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
if (indexPath.section==0){
switch (indexPath.row) {
case 0:
cell.textLabel.text = _team.teamName;
break;
case 1:
cell.textLabel.text = _team.headCoach;
break;
default:
break;
}
}
if (indexPath.section ==1) {
Player *p = [_fetchedResultsController objectAtIndexPath: indexPath];
cell.textLabel.text = p.firstName;
cell.detailTextLabel.text = p.team.teamName;
}
return cell;
}