> 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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to