background preloader

Patterns

Facebook Twitter

iPad Tutorials, iPad Development Training and iPad Programming via Real Tutors and Live Videos. Dynamic Design Patterns in Objective-C. Patterns in Objective-C: Singleton Pattern. One of the challenges in switching to a new language is figuring out how design patterns adapt.

Patterns in Objective-C: Singleton Pattern

Sometimes the language has built-in facilities for the pattern, or features that work-around what the pattern was designed to do in the first place. In Python, for example, it is trivial to implement a Command Dispatch Pattern and a Singleton pattern is almost wholly unnecessary–just create a module and put “”"This module implements the singleton pattern”"” at the top and voilà! It is a “singleton” for all intents and purposes.