ios不兼容的指针类型从NSError_autorelasing分配给NSError_strong



我收到这个错误:

incompatible pointer types assigning to NSError _strong from NSError _autoreleasing

这是我的头文件:

@interface myClass : NSObject
{
    NSError *errorPointer;
}

这是我的实现文件:

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

你们中有谁知道我为什么或如何修复这个错误?

我真的很感激你的帮助。

(NSError**)错误应为(NSError*)错误

最新更新