为什么Apple的方法不会将NSError**
声明为NSError * __autoreleasing *
?
Transitioning to ARC Release Notes似乎表明它们应该是(?)。
例如,NSFileManager.h中的所有例程。但我实际上并未使用“转换为ARC发行说明”中所述的内容看到任何的Apple标头:
and the method declaration would typically be:
-(BOOL)performOperationWithError:(NSError * __autoreleasing *)error;
可能是因为支持遗留代码库,其中所有NSError * error = nil;
声明都意味着strong
,因此如果Apple将__autoreleasing
置于其中,则会导致临时{{}每次都要创建1}}局部变量?我唯一能想到的就是。