相关疑难解决方法(0)

自动引用计数问题:将非本地对象的地址传递给__autoreleasing参数以进行回写

我正在尝试将指针传递给指向某个方法的指针,但显然ARC在如何操作方面存在一些问题.这里有两种方法:

+ (NSString *)personPropertyNameForIndex:(kSHLPersonDetailsTableRowIndex)index 
{
    static NSArray *propertyNames = nil;

    (nil == propertyNames) ? 
        [self SHL_initPersonPropertyNamesWithArray:&propertyNames] : NULL;
}

+ (void)SHL_initPersonPropertyNamesWithArray:(NSArray **)theArray
{
    *theArray = [[NSArray alloc] 
                 initWithObjects:@"name", @"email", @"birthdate", @"phone", nil];
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

自动引用计数问题:将非本地对象的地址传递给__autoreleasing参数以进行回写

在出现以下命令的行上:

[self SHL_initPersonPropertyNamesWithArray:&propertyNames] : NULL;
Run Code Online (Sandbox Code Playgroud)

pointers objective-c ios5 automatic-ref-counting

14
推荐指数
1
解决办法
9856
查看次数