다음은 nib 파일의 tableviewcell을 tableview에 넣는 코드로 사용됩니다. 나는 tableviewcell을 tableview와 같은 펜촉으로 찍었다. 나는 또한 viewdidload에있는 세포를 초기화하려했지만 아무 것도하지 않았다. 내가 할IB의 UITableViewCell이 값을 NULL로 표시합니다.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"identifier";
NSLog(@"the cellidentifier is %@", CellIdentifier);
bookmarksTableViewCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSLog(@"the cell is %@", bookmarksTableViewCell);
return bookmarksTableViewCell;
}
오류가 나는 IB의 연결을 확인하고 그들도 재배 선 한
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
하지만 결과는 동일납니다. 셀을 NSLog하려고하면 null이됩니다.
Interface Builder에서 셀의 식별자를 "indentifier"로 설정 했습니까? 나는 그것을 "Custom Cell"이나 "Bookmark Cell"또는 무엇인지 식별하는 것과 같은 다른 것이라고 부를 것입니다. 여기서 식별자 "식별자"가있는 셀을 호출합니다. –