How can I remove value that was previously registered via [NSUserDefaults registerDefaults:] call

后端 未结 3 1217
暗喜
暗喜 2021-01-05 10:33

I have bunch of preference values registered via [NSUserDefaults registerDefaults:] call on application startup. I need to replace them at some stage with new o

3条回答
  •  天涯浪人
    2021-01-05 11:11

    You can use removeVolatileDomainForName: to remove the NSRegistrationDomain. This clears all values registered via registerDefaults:. But if you need to do this you’re most likely doing something wrong. The right way would be to actually store the new settings using one of the set...:forKey: methods.

提交回复
热议问题