ios incompatible pointer types assigning to NSError _strong from NSError _autoreleasing

StackOverflow https://stackoverflow.com/questions/17281841

  •  01-06-2022
  •  | 
  •  

Frage

I'm getting this error:

incompatible pointer types assigning to NSError _strong from NSError _autoreleasing

here is my header file:

@interface myClass : NSObject

{
    NSError *errorPointer;
}

This is my implementation file:

- (id)initWithError:(NSError **)error
{
    if (self = [super init])
    {
        errorPointer = error; // <-- here is where I'm getting the error
    }
    return self;
}

any of you knows why or how can I fix this error?

I'll really appreciate your help.

War es hilfreich?

Lösung

(NSError **)error should be (NSError *)error

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top