developer.apple. com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html 说是
...应通过禁用任何功能来防止用户编辑该首选项 适当的控件.
...should prevent users from editing that preference by disabling any appropriate controls.
NSUserDefaults类是线程安全的. NSURL和 文件参考网址...
The NSUserDefaults class is thread-safe. Persistence of NSURL and file reference URLs...
经过长时间的讨论,事实并非如此
This long discussion says it isn't
www.cocoabuilder/archive/cocoa/155227-nsuserdefaults -thread-safety.html
那么哪个是对的?还有为什么意见分歧.
So which one is right? Also why the difference of opinion.
推荐答案Apple iOS 5.1和OS X 10.7文档说它是线程安全的.因此它是线程安全的.
The Apple iOS 5.1 and OS X 10.7 documentation say that it is thread-safe; therefore it is thread-safe.
更多推荐
NSUserDefault线程安全吗?
发布评论