UITableViewDataSourceプロトコルのCellForRowAtIndexPathメソッドは次のとおりです。私はそのコードをウェブサイトで見ました。
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *TableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableIdentifier];
}
cell.textLabel.text = [playersReady objectAtIndex:indexPath.row];
return cell;
}
私の質問は次のとおりです。
ここで定義されたの
cell
はなぜ= [tableView dequeueReusableCellWithIdentifier:TableIdentifier];
ですか?それはどういう意味ですか?そのコードにコメントすれば、すべてうまくいきます。そのコードは何ですか?うーん...cell
inif
ステートメントは(SimpleTableItem )に等しいnil
場合にどのように等しくなりますか?そのコードを書いたのは何ですか?cell
TableIdentifier
SimpleTableItem
TableIdentifier
と等しいのはなぜですか?何のために?