I have a class AudioInfo which contains some NSString objects.
In main() I create (allocate) some AudioInfo object.
Later in main() I want to have the second AudioInfo object with the same NSString objects.
I init the second one with NSStrings from the first one.
Question:
Should I retain the first AudioInfo object to have them both with retain count = 1 after creating (allocating) the second one?
In this case,
AudioInfoshould simplycopythe string properties to its ivars (you should be declaring yourNSStringpropertiescopyby default) and each instance would manage its own references. You then release theAudioInfoinstances when you are finished using them. That’s all there is to it.