3

I'm trying to support undo/redo in an iOS app that uses GLKit.

When I try the following:

GLKVector3 currentTranslation = _panningObject.translation;
[[self.undoManager prepareWithInvocationTarget:_panningObject] setTranslation:currentTranslation];

I get a crash:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSMethodSignature signatureWithObjCTypes:]: unsupported type encoding spec '(' in '4(_GLKVector3={?=fff}{?=fff}{?=fff}[3f])8''

Any ideas?

Tom Irving
  • 10,041
  • 6
  • 47
  • 63

1 Answers1

0

Still got no idea why GLKVector3 won't play nice, but I'm using this as a workaround:

- (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];
}

EDIT:

https://twitter.com/bddckr/status/370144778090192896 https://twitter.com/bddckr/status/370145021804425216

Tom Irving
  • 10,041
  • 6
  • 47
  • 63