Am 19.04.2008 um 18:46 schrieb Jerry Krinock:
I often write methods that take an (NSError**)error_p argument. In the documentation of Apple methods that do this, I read that the NSError** will be set if there ^is^ an error, but most do not specify what will happen if there is ^not^.


Well, when Apple code doesn't specify it will be set to NIL, one can't rely on that, so definitely rely on the return value for those.

However, when I write my own code, I like to set the error variable on NIL to indicate no error, because that's just better style. Then again, I also initialize list counters in code like:

        int x = 0;
        for( x = 0; x < maxCount(); x++ )
                ;

Simply because you'll never know who is going to insert their own code between those two lines and re-use x. Even if you work alone, you may screw up two years from now.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

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