For example, I created an array and put some custom class into it. Should I nil and release them by a certain order? If I put background ASIHTTPRequests in a array, will there be a leak if I release the array first? Is it the same in ARC? Thank you for your answers.
Share
When you add an object to an
NSArrayit is automatically retained, then when youreleasethe array areleasesignal is sent to all the objects in that array. So:Is the same as:
In fact the 2nd code is a very common practice when you want to create an array of objects without taking care of individual references to those objects.