On Sat, May 9, 2009 at 8:34 AM, Andrew Wood <ajw...@iee.org> wrote:
> Investigated it a bit further.  It works if I declare the string in the
> method where Im doing the assignment, but what I was trying to do, and
> really need to do, is decalre the std::string in the app controllers header
> file, so that its visible to all methods in the controller, then do the
> assignment in an action method which is called when a button is clicked.

That you're making this variable an instance variable is the kind of
information that's really handy to put in the initial question.

C++ objects do not work by default as Objective-C instance variables
because their constructors and destructors don't get called. This can
cause crashes like you're seeing and is probably the cause of your
trouble. Enable "Call C++ Default Ctors/Dtors in Objective-C" in your
build settings and see if that helps.

Otherwise, post more complete code and the full stack trace of the crash.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to