from: In which situations do we need to write the __autoreleasing ownership qualifier under ARC?
- ( BOOL )save: ( NSError * __autoreleasing * );
The compiler will then have to create a temporary variable, set at __autoreleasing. So:
NSError * e = nil;
[ database save: &error ];
Will be transformed to:
NSError __strong * error = nil;
NSError __autoreleasing * tmpError = error;
[ database save: &tmpError ];
error = tmpError;
Okay, now the transformed code seems to work just fine. At the end I expected that it'll work properly despite a "little" (very little) bit in efficient. So why bother specifying autoreleasing?
To be more exact. I understand that we "should" use __autoreleasing
when we pass on pointer to pointer. However, if the only thing we got is just a very slight performance gain, then what's the point?