如何更改下面的代碼與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