In iOS 5, “retain” and “release” are not supported any more. Instead “strong” and “weak” are the new way.
iOS 4 code:
@property(nonatomic, retain)
@property(nonatomic, assign)
iOS 5 code:
???
???
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“In iOS 5, retain release are not supported any more.” They are, just not when using ARC.
When using ARC,
-[<NSObject> retain]is a no-op.For properties, you can use
strongif using ARC but that’s not required (you can useretaintoo if you like).strongandretainare identical:Just make sure you are consistent (don’t use both
strongandretainin the same project).