I'm storing Chipmunk Physics' cpShape
objects in an NSMutableDictionary
by way of NSValue
objects and the following lines of code:
NSValue *shapeValue = [[NSValue alloc] initWithBytes: shape objCType: @encode(cpShape)];
[staticBodiesInUse setObject: shapeValue forKey: name];
I now need to get the cpShape
back out, to compare it to another shape. How can I do that? I see a getValue:
method in NSValue
but it needs a buffer, not too sure what to do with it.
cpShape *
is problem free? I don't think so and will lead to insidious bugs unless used very carefully. – Ringtail