On Sat, May 24, 2008 at 5:12 PM, Graham Reitz <[EMAIL PROTECTED]> wrote:
> What is the preferred method to halt a cocoa application on a runtime error
> occurring in the initWithFrame method?

For programming errors, like "you called me with inconsistent
arguments!", Cocoa typically uses exceptions.  You can use NSAssert as
a convenience for throwing exceptions on supposedly unreachable
conditions.

For softer errors that the programmer cannot control and you'd like to
actually tell the user about, like inability to read a file from disk,
Cocoa uses NSError.  These are user presentable errors, displayed in a
sheet most often, possibly with recovery options.

It sounds to me like you're in the first category.  See
<http://developer.apple.com/documentation/Cocoa/Conceptual/Exceptions/Exceptions.html>
for more detail.

NSError is discussed at
<http://developer.apple.com/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/ErrorHandling/chapter_1_section_1.html>.

-Ken
_______________________________________________

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