Taking Notes

cause i'll forget

PSA: Property Shenanigans

What type of storage does this property use?

@property id thing;

Trick question.

It depends.

Pre-ARC and in GC it’s an implicit assign, post-ARC, but before Xcode 4.3 it’s not a valid declaration because explicit storage is required.

In Xcode 4.3+ with ARC it’s an implicit strong.

Now you might say to yourself:

“Well that’s a little convoluted, but I guess ultimately it makes sense. Strong is what you want most of the time.” - You (Maybe)

And you’d be right.

And if you used the ARC conversion tool, no big deal because it will do the right thing.

But, if you don’t use the ARC conversion tool, well too bad for you because you’ll get no warnings about this change.

AND… it’s completely undocumented.

I’m all for improvements, but maybe, just maybe, write it down somewhere.

I’ve filed a bug and as always appreciate dupes: Radar OpenRadar