gpt4 book ai didi

objective-c - NSUserDefault 线程安全吗?

转载 作者:太空狗 更新时间:2023-10-30 03:08:22 26 4
gpt4 key购买 nike

https://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.

The NSUserDefaults class is thread-safe. Persistence of NSURL and file reference URLs...

这个冗长的讨论表明它不是

http://www.cocoabuilder.com/archive/cocoa/155227-nsuserdefaults-thread-safety.html

那么哪个是对的呢?还有为什么意见不同。

最佳答案

Apple iOS 5.1 和 OS X 10.7 文档说它是线程安全的;因此它是线程安全的。

关于objective-c - NSUserDefault 线程安全吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10864482/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com