How to declare a double pointer property in Objective-C?

I have a function declared as follows:

- (void)loadWithCompletion:(MyCompletion)completion error:(NSError**)error;

The function takes a double pointer to an NSError, so I can report errors to the caller. Termination (and possibly an error) will occur some time after the function is called. I need to keep NSError ** as a property so that I can use it when the specified time passes.

@property(nonatomic, assign) NSError** error;

This property declaration gives me an error:

Pointer to a non-const type NSError * without explicit ownership.

+4
source share
1 answer

add __autoreleasingbetween **to giveNSError*__autoreleasing* error

Xcode 5.1 ARC " " ( ). , 5.1 , .

, autoreleased, , , , .

, , . , .

+7

Source: https://habr.com/ru/post/1535817/


All Articles