• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Which exception handling system should I use?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which exception handling system should I use?


  • Subject: Re: Which exception handling system should I use?
  • From: Derrick Bass <email@hidden>
  • Date: Mon, 24 Apr 2006 13:05:49 -0700

On Apr 24, 2006, at 7:38 AM, Ondra Cada wrote:
+ more convenient (@finally, can 'return' out)
+ more safe ('return' out won't fail)
- has to be explicitly switched on
- not portable to older systems
- problem with breaking at (objc_exception_throw can be used, but unlike raise, there's no guarantee for future)
+ allows to throw any object (not necessarily an NSException--if doing so, beware compatibility with older code!)
- does not allow dynamic expansion (you cannot override objc_exception_throw by subclass/category/poseAsClass).

If you are using Objective-C++ then there is another minus to @try: - marks variables in the subroutine with the @try block as volatile

C++ won't allow you pass a reference or pointer to a volatile object to a function that doesn't explicitly say it can accept volatile objects (this includes member functions); so you end up having to do a lot of casting to get the code to compile.

I haven't quite figured out the pattern to this; some variables seem to get marked volatile and some not. The volatileness is not confined within the @try block; it affects all the code that follows the block. Why variables are marked as volatile in the first place, I have no idea. Maybe someone can explain that.

Derrick

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Which exception handling system should I use?
      • From: Brian Stern <email@hidden>
References: 
 >Which exception handling system should I use? (From: Matteo Manferdini <email@hidden>)
 >Re: Which exception handling system should I use? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Getting a table to resize columns. I'm doing everything right but it's not working?
  • Next by Date: Re: Core-Data, can you issue an NSrequest from awakefrominsert
  • Previous by thread: Re: Which exception handling system should I use?
  • Next by thread: Re: Which exception handling system should I use?
  • Index(es):
    • Date
    • Thread