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

Xcode, Cocoa and std::list


  • Subject: Xcode, Cocoa and std::list
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Fri, 27 Mar 2009 13:04:38 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Xcode, Cocoa and std::list

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.

However, if I declare

   std::list<int> myList;

inside a method of myClass, then it too works properly.  Moreover, if I
declare

    std::vector< std::list <int> > myVecOfLists;

in the *interface*, then both the vector and its list components work
properly.

Is there some Xcode/Cocoa/ObjectiveC++ fine print that I should have read?
or some other fault obvious to anyone?

TIA.

--
Mike McLaughlin

 _______________________________________________
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

  • Follow-Ups:
    • Re: Xcode, Cocoa and std::list
      • From: Chris Hanson <email@hidden>
    • Re: Xcode, Cocoa and std::list
      • From: Dave Carrigan <email@hidden>
    • Re: Xcode, Cocoa and std::list
      • From: Luca Ciciriello <email@hidden>
  • Prev by Date: Re: Why can't Xcode find this file?
  • Next by Date: Re: Xcode, Cocoa and std::list
  • Previous by thread: Re: Why can't Xcode find this file?
  • Next by thread: Re: Xcode, Cocoa and std::list
  • Index(es):
    • Date
    • Thread