简体   繁体   中英

Is there any downside to using __weak in non-ARC iOS Objective-C code?

I'm writing iOS Objective-C code sans ARC. I prefer

__weak MyClass *myWeakIVar;

to, eg

MyClass *myWeakIvar; // weak

Not only does it read better to me, but if I ever use this code on a garbage-collected platform, etc., I get the benefits of the __weak directive. Are there any downsides to this? Put another way, is it presently equivalent (again, w/o ARC) to a noop on iOS?

根据此线程 ,如果禁用了ARC, __weak在iOS上不执行任何操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM