I'm trying to use a std::list in my objective-c program and having run-time issues.
I have (edit for brevity)
#import <list>
...
@interface Foo {
std::list<Bar *> *myList;
}
...
@implementation Foo
-(void)loopList {
myList = new std::list<Bar *>;
for (std::list<Bar *>::iterator ii; ii != myList->end(); ++ii)
{
// Do nothing here
}
}
Everything compiles fine, but I get a EXC_BAD_ACCESS while executing the for loop. I'm not doing anything with the contents, just looping though them (for now).
I'd use NSMultableArray, but I need to quickly insert and remove elements while I'm iterating, which is not possible. Also, I'd like to use the stl for speed issues.
I have my files set to sourcecode.cpp.objcpp.
Thanks in advance.