I\'m new to Objective-C and can\'t seem to get the memory management code right. I have the following code:
Media* myMedia = [self.myMediaManager getNextMedia];
The general rule for memory management is as follows:
For every retain, alloc, copy, or new, you need to call release or autorelease.
Since you did not call any these, you do not need to release myMedia.
For more information, take a look at this other answer I posted that deals with the subject. Also, since you are new to iOS development, I suggest looking at this answer as well.