I am working with NSInvocation
and needed to retrieve one of the attributes from it.
I was using the following code, but I had some weird behaviour calling [invocation invoke];
:
NSString *propertyName = nil;
[invocation getArgument:&propertyName atIndex:3];
I read that in order to make it work under ARC, we need to use __unsafe_unretained
:
__unsafe_unretained NSString *propertyName = nil;
[invocation getArgument:&propertyName atIndex:3];
It worked, good!! But I would like to understand why. Can anyone explain this?