ARC and Core Data generated NSManagedObject Subclasses

431 views
Skip to first unread message

Anthony Egerton

unread,
Nov 14, 2011, 3:24:29 PM11/14/11
to cocoah...@googlegroups.com
I've just converted my app with Core Date over to ARC.
The conversion wizard changed all my retain properties to strong, including my model classes.

When I generate my NSManagedObject subclasses from the model, it generates them with retain properties again.

I assume I should change them back to strong?

Is there any way to get Xcode to generate them with strong to begin with?

Cheers,
Anthony


Paul Chapman

unread,
Nov 14, 2011, 4:19:06 PM11/14/11
to cocoah...@googlegroups.com
The compiler currently accepts both strong and retain. The strong parameter compiles down to retain anyway so it makes no difference.

Since the continuing use of retain is confusing, and technically against the ARC rules, I'd change them to strong manually.

Paul



--
You received this message because you are subscribed to the Google Groups "Australian Cocoaheads" group.
To post to this group, send email to cocoah...@googlegroups.com.
To unsubscribe from this group, send email to cocoaheadsau...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocoaheadsau?hl=en.




--
Paul Chapman ~ Director
Long Weekend / 61.435.490.300 / longweekendmobile.com / @pchap10k


Oliver Jones

unread,
Nov 14, 2011, 5:52:11 PM11/14/11
to cocoah...@googlegroups.com
The retain and strong keywords in @property declarations are the same thing.  The reason for the change in terminology is to make you think about "ownership" rather than retain/release.  Also, the terminology is shared with garbage collected Objective-C (only available on the desktop).

I would encourage you to be consistent in your code and use just strong or retain and not both in ARC code.

Regards
Reply all
Reply to author
Forward
0 new messages