In the classic template below, the return cellfrom is dequeueReusableCellWithIdentifieralways not nil. What for? Shouldn't we first select a cell, and then we have the possibility of reuse?
cell
dequeueReusableCellWithIdentifier
nil
I am using a custom cell and it was created in a storyboard. (However, if I used the UITableViewCell by default, the phenomena are the same - the returned cell is still always non-nil).
non-nil
Enviroment: Xcode 4.3.3 iOs 5.1
AlbumListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AlbumCell"]; //cell always non nil --- why?? if(cell == nil){ cell = [[AlbumListCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"AlbumCell"]; }
UITableViewCell , dequeueReusableCellWithIdentifier ( "AlbumCell" ) , UITableView . , . , .
, , . , , , . , , , , , , aloc init . , , xcode, , , , .
, iTunes iPad iPhone - Paul Hegarty - Stanford CS193p. (25) 9. 26 .