Tag Archives: singleton

How to implement MVC pattern in cocos2d game

Model-View-Controller (MVC) is a widely adopted pattern for handling user interface interactions in web based applications. Web development stacks such as Ruby On Rails, Django or ASP.NET MVC are different approaches to MVC in web development on different platforms, but all of them share the same main principle – separation of domain logic from the [...]
Posted in iPhone | Also tagged , , , , , , , , | 12 Comments

3 ways to implement Singleton pattern in Objective-C

Singleton pattern is used when you need to ensure that only one instance of a class can be instantiated and you need a global access to it. The most widely used implementation of this pattern in .NET is the following (from MSDN): public sealed class Singleton { private static readonly Singleton instance = new Singleton(); [...]
Posted in iPhone | Also tagged , , , , , | 1 Comment