I have a situation similar to this: http://stackoverflow.com/questions/2698591/objective-c-how-to-use-memory-managment-properly-for-asynchronous-methods
I have an object that asynchronously downloads & parses an xml doc. It then has a delegate method that transfers the data it retrieved to the caller.
My 2 questions are:
When do I release the data retrieving object? The link I posted above gives 2 answers, one says release in the delegate and one says release immediately, which is correct (or which is better if both answers are correct)
My second question is, what is the best way to transfer the retrieved data to the caller? At the moment I have
self.imagesDataSource = [articleImagesParserObject.returnedArray copy];
I used copy because, as far as I understand, that makes the mutable array immutable. Is that correct?