0
이 내 데이터 모델코어 데이터 : NSFetchedResultsController
내의 TableView에서, 나는 내가 그들을 가져 오는 경우
다음 first
및 city
내 코드 표시 할. 내가
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"TableCell";
TableCell *cell = (TableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil)
{
cell = [[TableCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
-(void)configureCell:(TableCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
NSManagedObject *obj = [fetchedResultsController objectAtIndexPath:indexPath];
// cell.lblName.text = @"";
[cell.lblName setText:[obj valueForKey:@"first"]];
// cell.lblCity.text = @"";
[cell.lblCity setText:[obj valueForKey:@"city"]];
}
@VNJ 미안 해요, 난 사용했다'valueForKey :'내가해야'valueForKeyPath : NSManagedObject의 아가씨, 당신은 당신의 코드를 수정할 수 있습니다,
Person
이라고한다'- 내가 수정하는 내 대답을 개정했다. – pbasdf