Objective-C: Use singleton vs. use class as an object?
问题 I've been wondering in what cases it is really necessary to adopt the singleton pattern in objective-C (e.g., define a dedicated class and create a single instance), that using the class as an object won't do. Particularly, I'm thinking of the following solution: Define and use appropriate class methods, instead of instance methods on the singleton instance; Use static variables (file-scope globals), instead of instance variables of the singleton instance; Use the class object when