I noticed in BMITime that if we comment out the last line:
employees = nil; the employees still deallocate. So it seems that line has no effect. Is that correct?
So I thought the section Retain count rules might explain this behavior. It gives conventions for when using ARC. The NSMutableArray Employees is created in the main.m using alloc (and init). I thought that according to the first bullet point, then we have the responsibility to release the object. But it appears that we don’t have to. Does Employees not fall under the first bullet point or has the way ARC works changed?
Also, I am having difficulty understanding the second bullet point. First of all, what are a few examples of creating an object any other way? It says the retain count is one. So that is the same as in the first bullet point, but who owns it? I guess in particular I don’t understand when an object would not be put in the autorelease pool. It seems like they all do.
According to the link below, “You cannot explicitly invoke dealloc, or implement or invoke retain, release, retainCount, or autorelease.” But the third bullet point mentions “you” sending an object retain and the fourth bullet point mentions “you” sending an object release or autorelease if you no longer need it. I am not sure what to make of all of this. Can anybody elaborate on the third and fourth bullet points?