IS setting employee variable to nil neccessary? help PLS!


#1

After using ARC,IS setting employee variable to nil neccessary?
In page 122 in main method,

[employees removeObjectAtIndex:5]; NSLog(@"Giving up ownership of array"); employees = nil;
I commented this line (employees = nil;) , I still got the same result. I thought employees got dealloced when main() method pop off from stack?
am I right? if not ,why I got the same result after //employees = nil;.


#2

i think it’s for the understanding of the chapter(s), to see the behaviour at all. there happens some changes during these chapters to this BMI-programm, like changing in ownership, observing leaks etc.
and maybe it’s a good thing to work like this, because when your programm gets larger and main isn’t finished that far, then it’s better being used to set variables to nil when where they point to isn’t needed anymore.
i think you’re right, when main is finishing it is (auto-)releasing all it’s ownership.
so far my understanding :astonished: