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: gcc 3.3 try - catch -finally



Chris Meyer wrote:
| At WWDC during one of the sessions (410 - Cocoa Update, I think), the
| presenter mentioned a new Objective-C exception syntax in Cocoa using
| @try, @catch, and @finally.
|
| Does anyone know if this available in the GCC 3.3 compiler? [sorry - I
| haven't installed the tools yet]

You'd do best to ask someone at WWDC. This list currently has an acute shortage of people who know anything reliable about Xcode or just-announced-at-WWDC features of anything.


| If so, does it play nicely with existing exception macros (NS_DURING,
| NS_HANDLER, NS_ENDHANDLER)?

I'd guess it's simply sweeter syntactic sugar for the same thing.


| Does it merge well with C++ exceptions (so as to make mixing of C++ and
| Objective-C possible)?

Mixing them is already possible. I do it regularly. The problem with the two varieties of exception is that Objective-C exceptions don't cause C++ destructors to be run. C++ exceptions are already completely compatible with Objective-C code. (The NS_DURING macros use setjmp()/longjmp() under the hood, and it's *those* functions that don't play well with C++. Unless @try/@catch adopts the C++ exception mechanism, Objective-C and C++ exception still won't be compatible.)


| If not, is there a recommended migration path?

Use C++ exceptions as the norm, and convert them to Objective-C NSExceptions where necessary.

Glen Fisher
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >gcc 3.3 try - catch -finally (From: Chris Meyer <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.