Jasper Blues
Jasper Blues

Reputation: 28746

UITableViewCell with nil reuseIdentifier

As I understood it, its valid to create a UITableViewCell with a reuseIdentifier of nil, if there's no expectation for that cell to be reused, for example when there will only be one or two rows for that type of cell.

Someone suggested the other day that this was incorrect. Is it?

Upvotes: 1

Views: 1601

Answers (1)

cania
cania

Reputation: 858

No, i think this is perfectly fine, according to Apple's official documentation:

reuseIdentifier

A string used to identify the cell object if it is to be reused for drawing multiple rows of a table view. Pass nil if the cell object is not to be reused. You should use the same reuse identifier for all cells of the same form.

https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UITableViewCell_Class/index.html

Upvotes: 4

Related Questions