Under the section “Retain Count rules” the first rule states:
[quote]If you create an object using a method whose name starts with alloc or new or contains copy, then you have taken ownership of it. …
You have a responsibility to release the object when you no longer need it.
Does this mean that every object I create with “alloc / init” I need to set it to “nil” to release it properly?
For example, in the following chapter we create the “executives” object below. Is it true that I need to manage its memory allocation because I created it with “alloc / init”?
NSMutableDictionary *executives = [[NSMutableDictionary alloc] init];
…and then I need to add this somewhere in the code…
executives = nil;