繁体   English   中英

NSUndoManager和GLKit

[英]NSUndoManager and GLKit

我正在尝试在使用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''

有任何想法吗?

仍然不知道为什么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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM