简体   繁体   中英

(iphone) nsarray, nsmutablearray retain/release

this is so basic, but quite not sure how to release array object in object-c.

I know that adding an object to array retains the object.
and removing it from an array releases the object.

When I have an array(mutable or not),
does 'releasing the array itself' also removes objects inside the array(therefore sending release to each object)?
Or should I remove the object first and release the array to reverse the operation (which is retaining array and each object in it).

Thank you

NSArrayNSMutableArray实例上调用release也会释放其对象,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM