Questions about NSUserDefaults
I have a couple of questions about NSUserDefaults in Mac OS X:
- When does the NSUserDefaults use the dictionary provided by registerDefaults? Only the first time the application is opened or every time the application is opened?
- W开发者_StackOverflow社区here is the information from NSUserDefaults stored?
- How can I reset NSUSerDefaults?
Thanks!
- Only the first time. But you can force an application to reuse the defaults with the terminal.
- ~/Library/Preferences/YourIdentifier.plist (e.g. com.apple.finder.plist)
- Terminal: defaults delete YourIdentifier (e.g. com.apple.finder)
Code:[NSUserDefaults resetStandardUserDefaults];
Actually it should change. I would try it with other controls like NSTextField. When it doesn't work you're doing it wrong
The idea of binding is exactly what you thought it is.
精彩评论