Re: Xcode, Cocoa and std::list
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