如何更改下面的代码与ARC兼容:现在ObjC:间接指针强制转换成Objective-C的指针
MyObj* fn = nil;
[self performSelectorOnMainThread:@selector(popSomething:) withObject:(id)&fn waitUntilDone:YES];
,我得到以下错误:
error: cast of an indirect pointer to an Objective-C pointer to '__strong id' is disallowed with ARC [4]
为什么你不能使用'[自performSelectorOnMainThread:@selector(queuedFileNamesPop :) withObject:FN waitUntilDone:YES ];'而不是? –
@AndreyZ:因为在这次调用返回后,'fn'仍然是'nil'。 – Albert
@Albert:那是因为fn从零开始。 – MusiGenesis