gpt4 book ai didi

iphone - 使用偏好(NSUserDefaults)崩溃?

转载 作者:行者123 更新时间:2023-12-03 16:01:30 25 4
gpt4 key购买 nike

我时不时遇到崩溃,我所知道的不是我启动的线程,其中提到了CFXPreferencesPropertyListSourceSynchronizer和CFXPreferencesPropertyListSource。
我确实有访问NSUserDefaults的单独线程。 (NSUserDefaults应该是线程安全的。)有人认识到这里出了什么问题吗?

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x444e4128
Crashed Thread: 5

Thread 5 name: Dispatch queue: CFPreferences Background Sync Queue
Thread 5 Crashed:
0 libobjc.A.dylib 0x34ec4f78 objc_msgSend + 16
1 CoreFoundation 0x3710de90 CFRetain + 76
2 CoreFoundation 0x3718aa96 __CFDictionaryStandardRetainValue + 62
3 CoreFoundation 0x37114fe0 CFBasicHashCreateCopy + 832
4 CoreFoundation 0x37124f50 CFDictionaryCreateMutableCopy + 388
5 CoreFoundation 0x3712d340 -[CFXPreferencesPropertyListSourceSynchronizer initWithPropertyListSource:forLockedSynchronize:] + 232
6 CoreFoundation 0x371b4800 __79-[CFXPreferencesPropertyListSource synchronizeInBackgroundWithCompletionBlock:]_block_invoke_0 + 56
7 libdispatch.dylib 0x302e5c52 _dispatch_call_block_and_release + 6
8 libdispatch.dylib 0x302f0ca4 _dispatch_queue_drain + 268
9 libdispatch.dylib 0x302f0b12 _dispatch_queue_invoke$VARIANT$up + 30
10 libdispatch.dylib 0x302f1784 _dispatch_worker_thread2 + 208
11 libsystem_c.dylib 0x33a34df4 _pthread_wqthread + 288
12 libsystem_c.dylib 0x33a34cc8 start_wqthread + 0

最佳答案

它在CFRetain上崩溃,所以我最好的猜测是您已经释放了一些键或某个值,或者您使用非对象作为键或值。

关于iphone - 使用偏好(NSUserDefaults)崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11064881/

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