views:

58

answers:

1

What's the point of this contentView property? I mean: Why aren't all the subviews just added to self?

Let me get that right: Every cell is a view (UITabvleViewCell is a UIView subclass). And this fat view has another fat view with same bounds sitting on top of it, called contentView. That contentView then carries all those other subviews.

Now why didn't they save that extra chunk of memory? Is there any genius logic behind this decision? Would love to understand the reason for this.

+3  A: 

The content view does not always have the same bounds as the cell. For instance, when entering editing mode, the delete button slides the content view to the right, resizing it in the process.

Jeff Kelley
makes sense, but isn't the delete button also part of the content?
dontWatchMyProfile
Nope. Check out http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html.
cduhn
The accessory view and/or reorder control are also outside of the content view. On that link, check out Figure 5-2.
Jeff Kelley