what is singleton class? Why the whole application creates a single instance?
Answer Posted / 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 View All Answers
What is retain counts?
When was ios invented?
What are the different store migration options? When are they used?
How to parse xml? Explain
How to pass parameter to selector function in swift? : IOS Architect
What is difference between shallow copy and deep copy in ios ? : IOS Architect
Can python apps run on ios?
How do you decide when to use infinite scroll or pagination in ios? : IOS Architect
Why core data is faster than sqlite?
Who calls the main function of app during the app launch cycle in ios?
How do you usually persist data on ios? : IOS Architect
How to delete images in ios?
Explain what is the stack of autorelease pools. How autorelease pool work under the hood?
What is nsmanagedobjectcontext?
What is reference count in ios?