Clay Bridges
Clay Bridges

Reputation: 11880

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, e.g.

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?

Upvotes: 2

Views: 3436

Answers (1)

shosti
shosti

Reputation: 7422

According to this thread, __weak does nothing on iOS if ARC is disabled.

Upvotes: 7

Related Questions