Table views

Status
Not open for further replies.
On Android, you have to put GridView row content inside a supplied view called "convertView".
On iPhone, you assign each UITableViewCell you make an identifier, and then call dequeueReusableCellWithIdentifier:.
In either case, you have to clear the supplied view of its contents and reset its background color, then fill it with new content.

Supposedly, this creates a huge optimization. I don't get how it can save all that much processing time or memory, though. So you don't have to create one view, but you have to deal with removing all of its contents before you proceed. And you only create the ones you can see at any time, anyway.
 
Views are expensive. There's a whole bunch of logic in them for tracking events, manipulating coordinate systems and the like. On a mobile device, you don't want too many views hanging around.

With the dequeueReusableCellWithIdentifier: method, you're meant to give different identifiers to different types of cell. That way when you come to update the content, you're probably only changing one or two values. That's going to be much less computationally expensive than creating a brand new view.
 
Status
Not open for further replies.