February 2013 - Byron Salau

objective-c singleton macro that supports both ARC enabled and disabled projects

Posted by | objective-c | 3 Comments

Im a big fan of Matt Gallagher’s singleton macro and have been using a slightly modified version of it by Oliver Jones.

Lately however I’ve been enabling ARC in my projects and came across the problem of including the macro only to have xcode whinge to me about all the release methods. I’m using a library so I wanted my macro to support both environments. I initially went back to Matt’s macro to see if he perhaps updated for this situation but it seems not so. I was also surprised to see that i couldn’t really find any thing else useful on the subject.

Read More