adspace


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


Please Help Members By Posting Answers For Below Questions

Why do all model object attributes get marked with @dynamic and not synthesised? What does @dynamic mean?

850


Explain parent-child context setup. How does it work? What are the advantages?

875


What is latest xcode version?

920


What is latest version of ios?

867


What are the different store migration options? How do they work?

879


What is latest ios version?

1003


What is dependency management tools?

877


In a single model, can I have few entities in one sqlite db file and remaining in another sqlite db file?

990


Why do all model object attributes get marked with @dynamic and not synthesised?

976


What's the latest version of ios?

977


What are transient properties?

925


How to handle concurrency problems in core data?

1017


What is nsmanagedobjectcontext? What are the different concurrency types? Explain them.

832


What is the purpose of reuseidentifier?

919