On Jun 27, 2008, at 12:31 PM, John Engelhart wrote:

-(BOOL)doSomething:(id)obj error:(NSError **)error
{
if(error != NULL) { *error = NULL; } // Make sure we clear the error object
}

Why are you doing this?

It's sort of ambiguous as to what should be returned by the indirect error pointer on the condition of success. I could think of several neat ideas if the expected behavior were defined up front, even requiring the caller to initialize the pointer to a default NSError singleton and allowing errors to accumulate in a stack like fashion. Alas, the only clearly defined behavior is that one failure, a NSError object is indirectly returned.

That's exactly what's expected.
"In general, a method should signal an error condition by—for example— returning NO or nilrather than by the simple presence of an error object. The method can then optionally return an NSError object by reference, in order to further describe the error."

mmalc

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to