Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uncaught exceptions thrown by Cocoa documented anywhere?




On Feb 15, 2008, at 12:50 PM, Chris Ryland wrote:
What you're saying is that the Cocoa culture doesn't generally use @try/finally to wrap teardown/cleanup/finalize code, so it's generally not safe to use exceptions for flow control, unlike Python?

Or even for indicating errors it would seem. Basically if the Cocoa code base is not designed to be exception-safe, then you better not ever let an exception escape into Cocoa code. Sounds reasonable.


I would just point out that this doesn't demonstrate a problem with exceptions per-se, any more than the existence of non-thread-safe code indicates a problem with using threads. Writing exception-safe code is similar to writing thread-safe code in that it's a lot easier if you've considered it throughout the code's lifetime rather than trying to introduce it late in the codebase's life. Given that exceptions were only recently added to Objective-C, it's not surprising that most existing ObjC code isn't exception-safe.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden
References: 
 >Uncaught exceptions thrown by Cocoa documented anywhere? (From: James Hober <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Adam P Jenkins <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Jens Alfke <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Bill Bumgarner <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Chris Ryland <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Bill Bumgarner <email@hidden>)
 >Re: Uncaught exceptions thrown by Cocoa documented anywhere? (From: Chris Ryland <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.