Sunday, December 15, 2013

Singleton in iOS 4+

Use dispatch_once to create singetons as Apple recommends.  See the following examples on stack overflow:

http://stackoverflow.com/questions/5720029/create-singleton-using-gcds-dispatch-once-in-objective-c

http://stackoverflow.com/questions/9119042/why-does-apple-recommend-to-use-dispatch-once-for-implementing-the-singleton-pat

No comments:

Post a Comment