Rubel
2003.04.18, 09:39 PM
I would like to have a vector as an instance variable. Is there a way to do this safely? I'm trying to call the constructor manually from the init method, like this:
- (id) init { [super init]; Time.vector(); return self; }
but that generates this error:
TrackerKeeper.mm:6: calling type `std::vector<Work, std::allocator<Work> >' like a method
I would use a pointer, but it would become invalid as soon as I change the vector, right?
What's the best way to go about using the STL with ObjC++? Or should I just give up and use a NSMutableArray?
- (id) init { [super init]; Time.vector(); return self; }
but that generates this error:
TrackerKeeper.mm:6: calling type `std::vector<Work, std::allocator<Work> >' like a method
I would use a pointer, but it would become invalid as soon as I change the vector, right?
What's the best way to go about using the STL with ObjC++? Or should I just give up and use a NSMutableArray?