On May 14, 2014, at 9:12 AM, William Squires <[email protected]> wrote:
> 
> Okay, in non-ARC code, one would override dealloc to put clean-up code (to 
> release retained objects, close open streams/files, etc...). But where do we 
> put this in ARC code?

You can still override -dealloc in ARC. You just can't release anything (ARC 
will do that for you; you can assign to nil if you need explicitly clear the 
pointer), nor can you call [super dealloc] (again, ARC will do that for you at 
the end of your -dealloc implementation).

But you should not be holding on to resources like file handles until -dealloc. 
You have no idea who might have retained a pointer to your object—use an 
explicit -close method instead.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to