mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-25 12:27:15 +00:00
feat: refine
This commit is contained in:
@@ -30,7 +30,7 @@ iOS 上应用必须被沙盒化,各个不同 App 之间的 Defaults Domain
|
||||
|
||||
通过设置符号断点可以看出, NSUserDefaults 内部在读写时会通过 `os_unfair_lock` 加锁进行多线程安全保护。
|
||||
|
||||

|
||||

|
||||
|
||||
## 存储性能如何
|
||||
|
||||
@@ -178,7 +178,7 @@ iOS 上应用必须被沙盒化,各个不同 App 之间的 Defaults Domain
|
||||
|
||||
通过对代码添加符号断点 `xpc_connection_send_message_with_reply_sync` 可以看到下面的堆栈
|
||||
|
||||

|
||||

|
||||
|
||||
执行 `[NSUserDefaults standardUserDefaults];` 可以发现是调用了 XPC,创建名称为 “com.apple.cfprefsd.daemon” 的 XPC Connection,且会发送一个 `xpc_connection_send_message_with_reply_sync` 的消息。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user