ios incompatible pointer types assigning to NSError _strong from NSError _autoreleasing

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

  •  01-06-2022
  •  | 
  •  

Pregunta

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.

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top