(I have read Apple's memory management guide, as well as other memory management help here, but am still confused on the following)
What should I do for memory management with convenience methods in a loop? Do I need to explicitly create an autorelease pool and then drain it. Or is it all automagic?
e.g.
for (i=0; i<numFilePaths; i++) {
// ...
NSString *componentString = [someString lastPathComponent];
// ...
}
In this example, I'm repeatedly getting a new string from lastPathComponent. Ignoring for a moment the bad manners in the same thing repeatedly, how should I be handling this memory management situation?
'componentString' is not retained at all, it has a lifespan only within the loop, and is used merely for comparisons with other strings. Thanks for any help.