Collections and ownership

When you add an object to a collection, the collection claims ownership of it. When you remove the object from the collection, the collection gives up ownership. This is true for NSMutableArray, NSMutableSet, and NSMutableDictionary. (An immutable collection also claims ownership of its objects, but the immutability of the collection means that all the objects in the collection are owned when the collection is created and disowned when the collection is deallocated.)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset