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

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -