• 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: When and how often do you mix C++ with Objective C in your project?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When and how often do you mix C++ with Objective C in your project?


  • Subject: Re: When and how often do you mix C++ with Objective C in your project?
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 30 Oct 2008 18:59:32 -0700

On Oct 30, 2008, at 6:30 PM, Peter N Lewis wrote:

About the biggest issue is that you cannot have C++ objects in an Objective C object (their constructors and destructors wont be called).

You can enable this for code that targets Tiger and later using the "Call C++ Default Ctors/Dtors in Objective-C" build setting in Xcode (GCC_OBJC_CALL_CXX_CDTORS), which maps to the -fobjc-call-cxx-cdtors compiler flag.


However, even when using this flag, NSCopyObject() will not invoke copy constructors, so it should not be relied upon for classes that use that runtime function to conform to the NSCopying protocol.

  -- Chris

_______________________________________________

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


References: 
 >When and how often do you mix C++ with Objective C in your project? (From: Boon Chew <email@hidden>)
 >Re: When and how often do you mix C++ with Objective C in your project? (From: Peter N Lewis <email@hidden>)

  • Prev by Date: Re: Silicon Valley CocoaHeads ... ?
  • Next by Date: Re: When and how often do you mix C++ with Objective C in your project?
  • Previous by thread: Re: When and how often do you mix C++ with Objective C in your project?
  • Next by thread: Re: When and how often do you mix C++ with Objective C in your project?
  • Index(es):
    • Date
    • Thread