objective c - What does "+resetStandardUserDefaults" actually do? -


Tried to use "+ resetStandardUserDefaults" of the NSUserDefaults class to reset default values ​​in your "factory" settings is. It does not have the appropriate method to use. Out of some archived discussions, find out in the SW that we should instead use the "removal objectfire" example method to remove user settings.

But just curious and hope that someone can explain the real use of "+ resetStandardUserDefaults". I have read the reference web manual about this but it is very brief and I do not think what it actually means ...

Somewhere (usually app representatives + in the beginning), you declare standard user default (prioritizing your app's preferences). + ResetStandardUserDefaults Your app means that this is the first time it launches and uses the way users declare them in app rep.

The wrong answer above is

As it says,:

shared users were made in default object Synchronizes the changes and releases it from memory

Reset section refers to the fact that standardUserDefaults object In memory is destroyed, so next time you have nothing to do with [NSUserDefaults StandardUserDefaults] but any of its first launch behavior Land.

A call will mean if its name has been changed flush defaults tosq or similar. It is by far the most misleading part of iOS SDK.

(I corrected these places because it is very high on searches and it did not want to improve the correction that anyone can not read.)

Comments