ios incompatible pointer types assigning to NSError _strong from NSError _autoreleasing

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

  •  01-06-2022
  •  | 
  •  

سؤال

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.

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top