toNewbie question: Could someone help me understand if the receiver of an initWith…. method take ownership of the returned object and should manage it.
For example:
NSString *msg; //could be used to hold some data, then
[msg initWithFormat: @"some text"]; //do I need to do a retain or is the method returning an auto-released string object
Just trying to get my head wrapped around methods that don’t use alloc explicitly
Methods with
initin the name are generally called in conjunction withalloc, as in:allocreturns an object with a +1 retain count, so you shouldn’t need to retain it.