what is singleton class? Why the whole application creates a single instance?



what is singleton class? Why the whole application creates a single instance?..

Answer / babu

A singleton class is a special kind of class where only one instance of the class exists for the entire application. (In the case of an iPhone app, the one instance is shared across the entire app.) Some examples in UIKit are [UIApplication sharedApplication] (which returns the sole instance of the application itself), and [NSFileManager defaultManager] (which returns the file manager instance). Singletons can be an easy way to share data and common methods across your entire app.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

Define cocoa?

0 Answers  


What is the use of double question marks (“??”) ?

0 Answers  


How to register as a iphone developer?

0 Answers  


Which json framework is supported by ios? : IOS Architect

0 Answers  


Explain difference between nil and nil?

0 Answers  






How to implement "load more" using nsfetchedresultscontroller?

0 Answers  


What are layers?

0 Answers  


What are moments and collections?

0 Answers  


What's the latest version of ios?

0 Answers  


DB updation when app new version comes ?

0 Answers  


Can I have relationship between entities in separate stores (in case of configurations)?

0 Answers  


What is the difference between viewdidload and viewwillappear?

0 Answers  


Categories