I have a method with the following signature:
- (void)takeIntsAndRecieveIntsAsync:(MyInt *__strong [])
completion:(void (^)(MyInt * __strong response[]))success;
I had a couple of questions:
1. How do I retrieve the argument using NSInvocation in this method?
- (void)forwardInvocation:(NSInvocation *)invocation
I tried the following but I don't get the correct value:
__unsafe_unretained MyInt *a[2];
[invocation getArgument:(void *) &a atIndex:index];
I can have an array of n int objects, so I should not hardcode 2. How do I determine the size of the object array at runtime? Do I need a sentinel value in the array to determine the bounds?
2. Is the __strong qualifier correct for both the input parameter and the block parameter? Please note that the block is asynchronous and would execute at a later time.