If I have this code,
+ (MyCustomClass*) myCustomClass
{
return [[[MyCustomClass alloc] init] autorelease];
}
This code guarantees the returning object is autoreleased.
What’s the equivalent of this in ARC?
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.
There is no equivalent in ARC, as you don’t need to do it yourself.
it will happen behind the scenes and you are not allowed to do it your self.
You simply use –
I suggest you to watch the ARC introduction in the 2011 WWDC as it very simple when you get it.
Look here:
https://developer.apple.com/videos/wwdc/2011/
And as the guy in the movie says –