dequeueReusableCellWithIdentifier:
Returns a reusable table-view cell
object located by its identifier.
- (UITableViewCell *)dequeueReusableCellWithIdentifier:(NSString
*)identifierParameters identifier A string
identifying the cell object to be
reused. By default, a reusable
cell’s identifier is its class name,
but you can change it to any arbitrary
value.
Ok so if by default it’s the class name, why should I put much brain force into thinking about an identifier? Could I provide just nil? Would it then use the class name? Or what did they try to say here? Must I make an NSString with the class name by myself and provide it as identifier?
No. The identifier will be used as a key in an internal NSMutableDictionary of NSArray to store the reusable cells. If you provide
nil, the-objectForKey:used in-dequeueReusableCellWithIdentifier:will crash.Besides, a table may have cells from different (sub)classes of UITableViewCell, so there’s no good default value to pass either.