I'm trying to learn Objective C & Cocoa, but I just can't manage to access a property inside an Object. Specifically an object from a C method. I'm working with the chipmunk dynamics library.
Chipmunk has something similar to NSPoint called cpVect. Now I have no problem defining a cpVect inside my object, but when I try to make the accessors using @property & @synthesize I keep getting errors: so
@interface ControlsLayer : Layer {
Sprite * touchMarker, *dragMarker;
cpVect * forceVector;
}
works fine
but
@interface ControlsLayer : Layer {
Sprite * touchMarker, *dragMarker;
cpVect * forceVector;
}
@property (retain) cpVect forceVector;
@end
gives me the error "property 'forceVector' with 'retain' must be of object type"
so without 'retain' i get an different error
"type of property 'forceVector' does not match type of ivar 'forceVector'"
I'm going round in circles trying to figure this out, is there a particular type I can use, is it an incompatibility between chipmunk and cocoa, or... or.... I don't know. Chipmunk is very light on the documentation and all the examples I've found don't seem to use objects, all the examples just use one class to process everything.
Any help, greatly appreciated. This thing is driving me nuts.