On 27-Jun-2011, at 9:22 PM, William Squires wrote:

> 2) Isn't the prevailing paradigm to raise an NSException if something goes 
> wrong?


No.  In Cocoa, exceptions are used to indicate programmer error, not runtime 
failure.  In general, Cocoa isn't exception safe, so if an exception occurs, 
your app should do its best to gracefully shut down, save data (without 
overwriting known-good data, since you can't be sure the app is in a good 
state), with an explanation to the user.

> or is 'init'ing a special case?


-init isn't special with respect to the above convention regarding exceptions, 
but it does have its own conventions.  Among those is that failure is indicated 
by returning nil.

Regards,
Ken

_______________________________________________

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

This email sent to [email protected]

Reply via email to