On Mar 1, 2018, at 06:13:19, Gerriet M. Denkmann <g@...> wrote:
I have a method like (macOS 13.3, Xcode 9.2 (9C40b)):
- (NSUInteger)computeFor: (NSUInteger)arg reason: (NSString * __autoreleasing *)reason
I am not quite sure whether __autoreleasing is the correct annotation. Is it?
But my real problem is this:
BOOL needReason = …
NSString **stringPointer = needReason ? &s : NULL;
NSUInteger c = [ self computeFor: 42 reason: stringPointer ]; // sometimes want to know the reason
I cannot figure out how to declare the stringPointer without getting compiler warnings.
How to do this?
Why not this?
NSUInteger c = [self computeFor:42 reason:needReason ? &s : nil];
Drummer, Mac geek