빠른 질문. Prototype 셀에 다른 셀을 추가하려고합니다. 나는 "cell.textLabel.text = person.firstname;"줄을 추가했다. 그러나 세포에서 아무것도 얻지 마십시오. 누군가 도와 줄 수 있어요.동적보기 셀에 다른 자막 추가
감사
당신이 뜻하는 일- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Persons Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
Person *person = [self.fetchedResultsController objectAtIndexPath:indexPath];
NSString *fullname = [NSString stringWithFormat:@"%@, %@", person.surname, person.firstname];
cell.textLabel.text = fullname;
cell.detailTextLabel.text = person.inEvent.name;
cell.textLabel.text = person.firstname;
return cell;
}