ARC equivalent of autorelease?
问题 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? 回答1: 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 - + (MyCustomClass*) myCustomClass { return [[MyCustomClass alloc] init]; } I suggest you to watch the ARC introduction in the