我正在尝试在使用GLKit的iOS应用程序中支持撤消/重做。
当我尝试以下操作时:
GLKVector3 currentTranslation = _panningObject.translation;
[[self.undoManager prepareWithInvocationTarget:_panningObject] setTranslation:currentTranslation];我遇到了崩溃:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSMethodSignature signatureWithObjCTypes:]: unsupported type encoding spec '(' in '4(_GLKVector3={?=fff}{?=fff}{?=fff}[3f])8''有什么想法吗?
发布于 2013-08-20 21:11:01
仍然不知道为什么GLKVector3不会玩得很好,但我正在使用这个作为解决方法:
- (void)setObject:(DrawableObject *)object translationX:(CGFloat)x y:(CGFloat)y z:(CGFloat)z {
GLKVector3 translation = GLKVector3Make(x, y, z);
GLKVector3 currentTranslation = object.translation;
[[self.undoManager prepareWithInvocationTarget:self] setObject:object
translationX:currentTranslation.x y:currentTranslation.y z:currentTranslation.z];
[object setTranslation:translation];
}编辑:
https://twitter.com/bddckr/status/370144778090192896 https://twitter.com/bddckr/status/370145021804425216
https://stackoverflow.com/questions/18300800
复制相似问题