Found the problem.. which leads to a new question.
In the applyToObject function of Operation.m there is this piece of
code to map arguments:
NSInteger index = 2; // Indices 0 and 1 indicate the hidden arguments
self and _cmd, respectively
for( id arg in _arguments ) {
[invocation setArgument:&arg atIndex:index++];
}
There seems to be some problem when you need to pass an
integer(basically the method seems to just get a random value passed
in). If I manually create an int and pass that then it works
properly. Perhaps we need to special case some of the argument types
so they aren't all just passed as a buffer?