2014-04-08 2 views
0

나는 스토리 보드와 jQuery과 만들려는 초기화되지 않습니다 내 앱을 돌렸는데 오류가 발생했습니다.있는 UITableViewCell은 그림와 같이

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' 

모자가 초기화되지 않았다면이 문제를 어떻게 해결할 수 있습니까? !

+1

셀의 식별자가 당신의 이야기 보드에서 "ITTableViewCell"해야합니다. – Rajesh

+0

스토리 보드는 매우 간단합니다. 'ITTableViewCell'에 대한 스토리 보드에 지정된 재사용 식별자는 '@ "ITTableViewCell"'입니다. – dasblinkenlight

+0

@rajesh 식별자를 설정하여 해결했습니다. 어떻게 든 tableviewcell의 속성 목록을 숨겨서 식별자 속성을 보지 못했습니다. ! – itenyh

답변

-1

이 같은 셀을 초기화 할 수 있습니다 :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"ITTableViewCell";  

    UTTableViewCell *cell = (UTTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 

    if(cell == nil) { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
    } 

    return cell; 
} 
+1

셀이 스토리 보드에서 만들어진 경우 if (cell == nil) 절을 가질 필요가 없습니다. 올바른 식별자를 사용한다고 가정하면 결코 종료되지 않습니다. – rdelmar

+0

그래, 옛날 방식이야. 더 이상 그렇게 할 필요가 없어. – meda

관련 문제