• 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: Xcode, Cocoa and std::list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode, Cocoa and std::list


  • Subject: Re: Xcode, Cocoa and std::list
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 27 Mar 2009 10:42:56 -0700

On Mar 27, 2009, at 10:04 AM, McLaughlin, Michael P. wrote:

Don't know if this is the proper forum for this but I encountered a strange
error, as follows:


In a Cocoa header for an ObjectiveC++ class, I have (after the list and
vector headers, etc.)


@interface myClass : NSObject {
  std::vector<int> myVec;
  std::list<int> myList;
}

In the implementation (myClass.mm) file, myVec behaves just as expected but
any reference to myList (e.g., myList.size()) crashes with a BAD_ACCESS
error.

You need to turn on the "Call C++ Default Ctors/Dtors in Objective-C" build setting for your target. Otherwise, Objective-C objects that have C++ objects as instance variables won't call the C++ objects' zero-argument constructors.


  -- Chris

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


References: 
 >Xcode, Cocoa and std::list (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Re: Xcode, Cocoa and std::list
  • Next by Date: Re: help with delegates
  • Previous by thread: Re: Xcode, Cocoa and std::list
  • Next by thread: help with delegates
  • Index(es):
    • Date
    • Thread