Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is great so far, you have an excellent taste in frameworks. It's also nice and light weight. I would suggest adding a singleton macro. Will try and put some of the boilerplate stuff I use in as a pull request when I get the time.


I used to love the Singleton (anti-)pattern. It's a huge improvement from using your AppDelegate as a global storage area, but it still encourages sloppy code. I find it the code much cleaner when you pass in the objects a class needs instead of calling up the singleton from all over the place.

There are some legitimate uses for singletons, but if you need a singleton macro, you're probably over using it.


I'm no fan of singletons either, but writing one with GCD dispatch_once is pretty simple. Nevertheless, I do have a macro for it:

http://lukeredpath.co.uk/blog/a-note-on-objective-c-singleto...

It's really for creating "shared" instances rather than true singletons, but who honestly needs a real singleton?


This is cool!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: