I have made my own Objective-C base class to use in Objective-C projects (without Foundation/Cocoa classes or API). While I don’t mind writing my own retains and releases, it’s a tedious process so I’m wondering if I can use ARC with my custom classes.
Specifically:
- Is it possible to use ARC with custom classes?
- Do my reference-counting selectors have to be called
retainandrelease(andautorelease)? - What additional requirements are there to make ARC work as expected for custom classes (other than including the
-fobjc-arcargument when compiling)?
Of course it is.
Yes, they do. Apple has hardcoded the method names of its favorite Objective-C library (Foundation) into the compiler. Damn bad programming pattern, isn’t it?
As far as I know, nothing.