最近、新しいクラス テンプレートを作成するときに、UITableViewController 実装のサブクラスである (Xcode -> ファイル -> 新規 -> ファイル) メソッドが部分的であることに気付きましたcellForRowAtIndexPath
。以下にその方法を貼り付けました。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
return cell;
}
(欠落している)、
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
実装する必要があります。これはバグですか、それとも何か他のものですか?