UITableViewController
에 표 내용을로드 할 때이 문제가 있습니다. 나는 xib없이 UITableViewController
을 만들었습니다. loadView
에서 표시 할 데이터 배열을 생성하는 함수를 호출하고 있습니다. 그리고 그 배열에서 tableView:cellForRowAtIndexPath:
나는 세포를로드하려고합니다. 그러나 어쨌든 나는 테이블 위에 아무것도 얻지 못하고있다. 그 외에도 콜에 대해 중단 점을 설정하면 호출되지 않는 것 같습니다. 아무도 내가 여기서 잘못하고 있다고 말할 수 있습니까?언제 -tableView : cellForRowAtIndexPath : get called?
답변
-tableView:cellForRowAtIndexPath:
은 처음에 셀을 채울 때 또는 새 셀을 화면으로 스크롤 할 때 호출됩니다. 그러나 적절한 수의 섹션을 반환하지 않으면 절대로 호출되지 않습니다 테이블보기의 행은 기본적으로 0입니다.
그것을 할 때마다 새로운 세포라는 방법입니다 ... cellForRowAtIndexPath 방법 : eimantas 말했듯이
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [yourArray count];
}
numberOfRowsInSection을 호출하면 배열이 비어 있다고 생각합니다. 어떻게 행 수가 호출되기 전에 배열을 만들 수 있습니까? – slonkar
필요가 없습니다. 배열이 준비되면'[self.tableView reloadData];를 호출하면된다. –
테이블을 작성할 때 cellforrowatindexpath가 호출됩니다. 테이블의 대리자를 self로 설정 했습니까? .h에 추가 했습니까?
, 당신은있는 tableView에 yourClass을 = (가리키는) 당신의 jQuery과의 "는 dataSource"대리자를 설정해야 (테이블을 처음 볼 때 테이블 높이의 전체 높이를 차지하는 데 필요한 수의 셀을 생성합니다.) 사용자가 테이블을 스크롤 할 때 호출됩니다 (새 셀을 만들지 않고 이전 셀을 새로운 데이터 필요)
- 1. tableView : cellForRowAtIndexPath : 지연로드 문제
- 2. 이 때 호출 : - (UITableViewCell *) tableView : (UITableView *) tableView cellForRowAtIndexPath : (NSIndexPath *) indexPath
- 3. EXC_BAD_ACCESS (SIGSEGV) on tableView : cellForRowAtIndexPath
- 4. tableView 가져 오기 : heightForRowAtIndexPath : tableView 다음에 일어날 : cellForRowAtIndexPath :?
- 5. tableView cellForRowAtIndexPath 처음에 여러 번 호출 됨
- 6. tableView : cellForRowAtIndexPath : 보이는 셀만 호출하지 않습니까?
- 7. CellForRowAtIndexPath 문제가 발생하면 언제 내부에 로컬을 릴리스 할 수 있습니까?
- 8. cellForRowAtIndexPath 지체 문제를 내 cellForRowAtIndexPath 내부
- 9. viewDidLoad before called didSelectRowAtIndexPath
- 10. tableView : cellForRowAtIndexPath : 하나의 맞춤형 uitableviewcell 만 반환하는 중
- 11. tableView : cellForRowAtIndexPath : 배열이 비어 있기 때문에 호출되지 않았습니까?
- 12. 은 cellForRowAtIndexPath
- 13. cellForRowAtIndexPath : XCode 템플릿이 맞습니까?
- 14. cellForRowAtIndexPath : indexPath는 항상 0입니다.
- 15. EXEC_BAD_ACCESS with cellForRowAtIndexPath 다시
- 16. UITable보기 numberOfRowsInSection & cellForRowAtIndexPath 오류
- 17. 선언되지 않은 식별자 "cellForRowAtIndexPath"사용
- 18. 정적 셀이있는 iOS cellForRowAtIndexPath
- 19. UITableView cellForRowAtIndexPath 문제
- 20. iOS - cellForRowAtIndexPath SQLite 데이터 정렬?
- 21. iPhone + cellForRowAtIndexPath
- 22. iOS 5 cellForRowAtIndexPath 메모리 누수
- 23. 느린 스크롤을 일으키는 UITableView cellForRowAtIndexPath
- 24. "cellForRowAtIndexPath :"의 indexPath.section의 이상한 동작
- 25. UITableView cellForRowAtIndexPath checkmark 액세서리 설정 이상한 행동
- 26. inviteHandler never called
- 27. Php Destruct Called Twice
- 28. initwithstyle : reuseIdentifier : not called
- 29. Dispose called Form을 호출했습니다.
- 30. onserviceconnected never called : android
'loadView' 메소드의 코드가 약간 도움이 될 것입니다. 그것 이외에 - 일단 당신이 테이블에'reloadData'를 호출 해보십시오. – Eimantas
당신의 tableView 델리게이트의'numberOfSectionsInTableView'와'numberOfRowsInSection :'메소드로부터 올바른 값을 반환하고 있습니까? – jonkroll
아니요. 행 수가 0이됩니다. – slonkar