English 中文(简体)
ARC的所有权是否构成问题?
原标题:Does the position of the ARC ownership qualifier matter?

Apple果往往举出这样的例子:

NSErr或__strong *err或= nil;

-(BOOL)performOperationWithError:(NSErr或* __autoreleasing *)error;

I d find it much more readable and logical if I could do it this way:

__strong NSErr或*err或= nil;


-(BOOL)performOperationWithError:(__autoreleasing NSError**)error;

A quick test revealed that the compiler is not complaining about my way of writing it. Am I doing it wrong anyways, 或is it just fine to write it like this?

最佳回答

无,所有权资格的地位根本就无关紧要。 由于所有权限定词对点对目标类型只具有意义,你的意图永远不会含糊不清。 汇编者可以很容易地列举你的意图,不管你是哪里。

如果你能够进入Siepa片开发商论坛,那么,你可以看到,我问到,在的同一问题。

问题回答

如果编辑者不抱怨,而且你不会因为这种情况而得到任何新的泄露,那么,这就会是好的。 您也可以从某种方式对您的组别产出进行比较,并看看是否有任何差异(使用<条码>diff工具,而不是文本Edit,或者你在晚上都在场:P)。

如果日志或日志相同,则汇编者将予以处理。 你们还可以在仪器之前和之后进行测试,看看是否有任何渗漏,以确保它能够正确处理记忆。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签