我正在將數據保存在coreData中以將其顯示在表中。 我有3個實體:Tableview,Sections,Rows和coreData - 行顯示多個(重複)
EntitySet的< ------ >> EntityRow < ------ >> EntityDetails
(許多關係)
在讀取和顯示數據在Table,Sections和Rows中,它工作正常。 但問題是,從EntityRow所有數據都顯示在所有部分,但我想顯示屬於第十節
什麼可能是錯在這裏只行?我不知道如何解決這個問題。 在我的tableView:的cellForRowAtIndexPath:方法,它看起來是這樣的:
- (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] autorelease];
}
EntityRows *rows = [_rowsX objectAtIndex:indexPath.row];
cell.textLabel.text = rows.title;
return cell;
}
或者可能可以做我的錯在coreData?錯誤的關係?
感謝您的幫助, brush51