7
votes

In XCode 4.3.2, when I run the ARC conversion refactor tool, all of my property options that were "retain" are NOT being changed into "strong". Is "strong" implied now or is this just a problem with XCode 4.3.2?

Example:

Before

@property (nonatomic, retain) NSString * someString;

After

@property (nonatomic) NSString * someString;
2
retain is still valid AFAIK, but it does seem like it should get converted.jscs
thanks guys, I was unclear in my question (see edits above). It's just removing the "retain" option without adding in "strong", which ends up being a compiler warning, and not running. It's doing this on all 5 of my projects.joseph.hainline
strong is the default if the attribute is not givenFelix
@Phix: No, for properties the default is assign. __strong is the default memory qualifier for variables.jscs

2 Answers

1
votes

"strong" is the default when using ARC (LLVM 3.1), so the new code is correct.
(before ARC, the default was "assign")
See http://clang.llvm.org/docs/AutomaticReferenceCounting.html#ownership.spelling.property

0
votes

Strong is the equivalent of the non-ARC retain. So when you shift from non-ARC to ARC XCode doesn't understand the word retain and hence removes it. Thereby causing an error or atleast a warning, as all the instance variables require atleast two properties declared.