noobsmcgoobs
noobsmcgoobs

Reputation: 2746

NSMutableArray with UITableView

I wanted to know what the implications (memory, processor overhead, etc.) there are to using a NSMutableArray to populate a UITableView rather than using an NSArray.

Reason I must use a NSMutableArray is because I don't know how many items I will have.

Upvotes: 0

Views: 53

Answers (1)

Dima
Dima

Reputation: 23624

An NSMutableArray IS an NSArray. The only difference is you can mutate them after they are created. You don't need to concern yourself with any other lower level differences between these two object types because they will never affect you.

The only thing you really need to watch out for is the model getting out of sync with the view. You want to make sure to reload the UITableView whenever you update the collection, to make sure they stay in sync. Generally you would do this by calling reloadData.

Upvotes: 2

Related Questions