【发布时间】:2013-01-16 17:52:36
【问题描述】:
我有一个 for 循环,然后将迭代对象传递给一个带有 byref 参数的方法并得到以下错误:
Implicit conversion of an Objective-C pointer to 'FOO *__autoreleasing *' is disallowed with ARC
和警告:
Incompatible pointer types sending 'Foo *const __strong' to parameter of type 'Foo *__autoreleasing *'
循环:
for (Foo *obj in objArray) {
FooTableCell *newCell = [self createFooCellWithItem:obj];
}
方法签名:
-(FooTableCell *)createFooCellWithItem:(Foo **)newObj;
我已按照this SO q&a 的建议无济于事。
编辑
在 obj 之前添加 & 会给我以下错误:
Sending 'Foo *const __strong *' to parameter of type 'Foo *__autoreleasing *' changes retain/release properties of pointer
【问题讨论】:
标签: ios objective-c ios6 automatic-ref-counting pass-by-reference