UITableView の customCell を作成しました。サーバーからデータをダウンロードして CustomCells に表示しています。
データの操作方法は、
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CustomCellReuseID";
LeaderBoardCell *cell = [leaderBoardTable dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[LeaderBoardCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
GetScoreBoard *ob = [leaderBoardArray objectAtIndex:indexPath.row];
[[cell title] setText:ob.fullname];
[[cell discription] setText:ob.points];
return cell;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [leaderBoardArray count];
}
CustomCell "LeaderBoardCell" は後でロードされますが、この前に UITableView のデフォルトの単純なセルが表示されます。
TableVeiw で CustomCell のみを読み込むことはできますか?