ios - Do I need to do registerDefaults: every time the app starts? -
I am developing an iOS app with the latest SDK.
I do this:
- (BOOL) Application: (UIApplication *) Application FinishLaunchingWithOptions: (NSDictionary *) Launch Option {NSUserDefaults * standardUserDefaults = [NSUserDefaults StandardUserDefaults ]; [Standard user defaults register defaults: [preferred default value dictionary]]; [Synchronize standard user defaults]; Yes come back } What is the need to register Defaults: Every time the app starts?
Yes, documents for registerDefaults: explicitly Explains:
The contents of the registration domain are not written to disk; You need to call this method every time your application starts.
Note that there is no need to call registerDefaults after register for the same reason .
Comments
Post a Comment