I am new to objective-c and ive downloaded the code from here http://apress.com/resource/bookfile/4175 and ran the Chapter 10, 10.01 CarPartsInit xcode project file.
One thing i am not clear about is that, does the memory management of a setter method
- (void) setEngine: (Engine *) newEngine
{
[newEngine retain]
[engine release];
engine = newEngine;
}
supposed to result with the engine retainCount to be 0 at the end of the program.
I ran some NSLog and when the program ends... the retainCount for engine was at 1... Should it go to 0 and be freed? or is this a memory leak?
Thanks =)