What is the use of -[NSUserDefaults registerDefaults:]?

前端 未结 5 2085
猫巷女王i
猫巷女王i 2020-11-27 04:05

What is the difference between:

[[NSUserDefaults standardUserDefaults] registerDefaults:
  [NSDictionary dictionaryWithObjectAndKey:anObject, @\"something\"]         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 04:52

    Another way of looking at it is this. If you delete the preferences file from ~/Library/Preferences, the defaults that are set by registerDefaults will be the ones that apply to the application until new preferences are set.

提交回复
热议问题