iphone - mutableArray cannot store nil objects

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-04-07T16:20:26Z Indexed on 2010/04/07 16:23 UTC
Read the original article Hit count: 491

Filed under:
|
|

I have a mutable array that is retained and storing several objects. At some point, one object may become nil. When this happens the app will crash, because arrays cannot have nil objects. Imagine something like

[object1, object2, object3, nil];

then, object2 = nil

[object1, nil, object3, nil];

that is not possible because nil is the end of array marker. So, how can I solve that? thanks for any help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk