• 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: c++ exceptions in objective c call stack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ exceptions in objective c call stack


  • Subject: Re: c++ exceptions in objective c call stack
  • From: "Clark Cox" <email@hidden>
  • Date: Sat, 5 Jul 2008 10:52:41 -0700

On Sat, Jul 5, 2008 at 10:11 AM, Uli Kusterer
<email@hidden> wrote:
> On 05.07.2008, at 17:01, Jim Crafton wrote:
>>>
>>> You cannot throw C++ exceptions across Objective-C functions. If you want
>>> to
>>> catch this exception, you will have to catch it in drawRect, and decide
>>> there what to do with it.
>>
>> The earlier emails seem to mention that for 64bit apps this will not
>> be a problem. Is that the case or did I misunderstand them?
>
> Well, define "problem": Of course, most C++ code will not try to catch or
> re-throw anything but std::exception-based exceptions, so you might still
> get odd behaviour because there's an NSException* thrown, or it'll just show
> up as an "unknown exception".

If C++ code behaves oddly in the presence of unknown exceptions, then
that C++ code is broken. :)

> But yeah, it won't trash your stack on 64-bit
> if you throw from C++ through ObjC or ObjC++. Of course, if you throw
> *anything* through straight C, it will still cause problems. But that's that
> way for any C++, ObjC or longjmp that marches through straight C code.

--
Clark S. Cox III
email@hidden
_______________________________________________

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: c++ exceptions in objective c call stack
      • From: Uli Kusterer <email@hidden>
References: 
 >c++ exceptions in objective c call stack (From: "Jim Crafton" <email@hidden>)
 >Re: c++ exceptions in objective c call stack (From: Scott Ribe <email@hidden>)
 >Re: c++ exceptions in objective c call stack (From: "Jim Crafton" <email@hidden>)
 >Re: c++ exceptions in objective c call stack (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: c++ exceptions in objective c call stack
  • Next by Date: Re: Layer Backed Views and CoreAnimation neither animate nor stay in place
  • Previous by thread: Re: c++ exceptions in objective c call stack
  • Next by thread: Re: c++ exceptions in objective c call stack
  • Index(es):
    • Date
    • Thread