【发布时间】:2012-02-08 16:08:54
【问题描述】:
我正在尝试迁移到 ARC,但我收到了这个错误,我真的不知道如何解决这个问题:
NSArray *itemsArray = nil;
__unsafe_unretained id *objArray = calloc (itemRange.length, sizeof (id)); //got the error here
[fdEntries getObjects:objArray range:itemRange]; //fdEntries is an NSMutableArray
itemsArray = [NSArray arrayWithObjects:objArray count:itemRange.length];
free(objArray);
这是错误:自动引用计数问题:ARC 不允许将非 Objective-C 指针类型“void *”隐式转换为“__unsafe_unretained id *”。
感谢您的帮助!
【问题讨论】:
-
你想做什么 - 你是不是想不使用
alloc对象数组?
标签: objective-c xcode4.2 automatic-ref-counting