【发布时间】:2013-02-04 11:34:48
【问题描述】:
我通过NSValue 对象和以下代码行将Chipmunk Physics 的cpShape 对象存储在NSMutableDictionary 中:
NSValue *shapeValue = [[NSValue alloc] initWithBytes: shape objCType: @encode(cpShape)];
[staticBodiesInUse setObject: shapeValue forKey: name];
我现在需要将cpShape 取出,以便将其与另一个形状进行比较。我怎样才能做到这一点?我在NSValue 中看到了一个getValue: 方法,但它需要一个缓冲区,不太清楚如何处理它。
【问题讨论】:
标签: ios objective-c cocoa-touch chipmunk nsvalue