Re: Can't delete file on device
Re: Can't delete file on device
- Subject: Re: Can't delete file on device
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 27 Mar 2012 16:02:40 -0700
> Okay, I made that change, but it seems blatantly incorrect to create an error return if it is also going to return true.
It only returns you something if it says it did, by indicating that an error occurred. Otherwise, the contents of the error parameter are undefined.
There are definitely some Apple frameworks which will modify the error parameter even if they succeed. There are definitely some which won't. So you can neither rely on it being nil nor on being non-nil, regardless of what you initialise it to.
So like it or not, this isn't about preference, it's about correctness.
ARC doesn't change much. The callee is still free to write something into the error parameter and leave it there; it'll merely be released by the caller, rather than the callee (which without ARC momentarily leaves a dangling pointer). So it'll reduce the incidence of leaks, but that's about it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden