Out of curiosity/excitement I have been reading whatever information I can find about ARC but I have one question I can't seem to find the answer to. Not sure if people can answer this due to NDAs or whatever, but I'll ask anyway. (There's plenty of information out there.......)
One thing ARC advertises is that you won't need to write dealloc methods anymore. Cool. But is this really true?
If I have a NSNetService or something, normally in my dealloc I would write
- (void)dealloc
{
[netService_ setDelegate:nil];
[netService_ stop];
[netService_ release];
[super dealloc];
}
Does ARC take care of that now? Or is not smart enough to know about stuff like that? If it isn't smart enough to know about that stuff (meaning I would still have to write custom deallocs in certain cases) would I have to release all ivars? Or just ones that wouldn't be simple releases?
- (void)dealloc
{
[netService_ setDelegate:nil]; // if these 3 lines are necessary...
[netService_ stop];
[netService_ release];
[myString_ release]; // would this one still be? or would ARC know to automagically add this
[super dealloc]; // seems this is forbidden in ARC
}
I guess my question really boils down to this: ARC says you won't have to write deallocs anymore in most cases; so when are the cases you do have to?