views:

31

answers:

1

I have question related to NSUserDefaults's standardUserDefaults. What exactly does the standardUserDefaults method do? Is it initializing the object?

+1  A: 

Yes or no. NSUserDefaults is a singleton, so there is ever only one instance of the class around, and standardUserDefaults is the method to get that single instance.

If there isn't an instance of NSUserDefaults yet, it is alloc'ed and init'ed and then returned, otherwise this already present instance is returned.

Douwe Maan

related questions