feat: refine

This commit is contained in:
LiuBinPeng
2022-05-30 15:03:36 +08:00
parent 6cd0cf5144
commit 55d66cc4c5
15 changed files with 149 additions and 149 deletions

View File

@@ -30,7 +30,7 @@ iOS 上应用必须被沙盒化,各个不同 App 之间的 Defaults Domain
通过设置符号断点可以看出, NSUserDefaults 内部在读写时会通过 `os_unfair_lock` 加锁进行多线程安全保护。
![](./../assets/NSUserDfault-lock.png)
![](https://github.com/FantasticLBP/knowledge-kit/raw/master/assets/NSUserDfault-lock.png)
## 存储性能如何
@@ -178,7 +178,7 @@ iOS 上应用必须被沙盒化,各个不同 App 之间的 Defaults Domain
通过对代码添加符号断点 `xpc_connection_send_message_with_reply_sync` 可以看到下面的堆栈
![](./../assets/NSUserDefault-XPC.png)
![](https://github.com/FantasticLBP/knowledge-kit/raw/master/assets/NSUserDefault-XPC.png)
执行 `[NSUserDefaults standardUserDefaults];` 可以发现是调用了 XPC创建名称为 “com.apple.cfprefsd.daemon” 的 XPC Connection且会发送一个 `xpc_connection_send_message_with_reply_sync` 的消息。