Ken
Ken

Reputation: 31161

UITableView and retaining cells

Does a UITableView instance send a retain message to each of its queued reusable cells?

[The point being I have a custom cell which I want to autorelease in a (class) method within the custom cell class.]

Upvotes: 0

Views: 239

Answers (2)

CharlieMezak
CharlieMezak

Reputation: 5999

Yes, the tableview retains the cells you return in the cellForRowAtIndexPath method. That's why the cell objects in the default implementation of that method are autoreleased.

Upvotes: 2

Nevin
Nevin

Reputation: 7809

How you get the custom cell in the first place? Most likely it's retrieved via the mainBundle's loadNibNamed method which you don't have the responsibility to release it anyway.

Upvotes: 1

Related Questions