gpt4 book ai didi

ios - 魔法记录崩溃: NSManagedObjectContext Queue EXC_BAD_ACCESS KERN_INVALID_ADDRESS

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:12:14 26 4
gpt4 key购买 nike

我正在使用 Magical Record 进行核心数据操作。

看来我在下面发布的崩溃只会发生在 iOS 7 中。而 EXC_BAD_ACCESS KERN_INVALID_ADDRESS 意味着一些对象被释放。我不太确定错误在哪里。对此有什么想法吗?谢谢。

Thread : Crashed: NSManagedObjectContext Queue
0 libobjc.A.dylib 0x39d7c636 objc_msgSend + 21
1 Foundation 0x2fee4d9d -[NSError dealloc] + 60
2 libobjc.A.dylib 0x39d81b6b objc_object::sidetable_release(bool) + 174
3 libobjc.A.dylib 0x39d820d7 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 358
4 CoreFoundation 0x2f4f5c19 _CFAutoreleasePoolPop + 16
5 Foundation 0x2feef637 -[NSAutoreleasePool drain] + 122
6 CoreData 0x2f336fb9 -[NSManagedObjectContext save:] + 944
7 Branch 0x20f87d __70-[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:]_block_invoke20 (NSManagedObjectContext+MagicalSaves.m:82)
8 CoreData 0x2f39a935 developerSubmittedBlockToNSManagedObjectContextPerform + 88
9 CoreData 0x2f39aa7b -[NSManagedObjectContext performBlockAndWait:] + 114
10 Branch 0x20f621 -[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:] (NSManagedObjectContext+MagicalSaves.m:128)
11 CoreData 0x2f39a935 developerSubmittedBlockToNSManagedObjectContextPerform + 88
12 libdispatch.dylib 0x3a26cdd7 _dispatch_barrier_sync_f_invoke + 26
13 CoreData 0x2f39aa73 -[NSManagedObjectContext performBlockAndWait:] + 106
14 Branch 0x205831 +[MagicalRecord(Actions) saveWithBlockAndWait:] (MagicalRecord+Actions.m:44)
15 Branch 0x1acdbb __62-[BREmployeeDataController getPositionsAtLocation:completion:]_block_invoke (BREmployeeDataController.m:42)
16 Branch 0x1ad87d __66-[BREmployeeDataController synchronizeStaffAtLocation:completion:]_block_invoke (BREmployeeDataController.m:193)
17 Branch 0x1d215b __116-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:uploadProgress:downloadProgress:success:failure:]_block_invoke80 (AFHTTPSessionManager.m:287)
18 Branch 0x1e326b __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2150 (AFURLSessionManager.m:308)
19 libdispatch.dylib 0x3a25a833 _dispatch_call_block_and_release + 10
20 libdispatch.dylib 0x3a25a81f _dispatch_client_callout + 22
21 libdispatch.dylib 0x3a25a777 _dispatch_main_queue_callback_4CF$VARIANT$up + 254
22 CoreFoundation 0x2f58c8a1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
23 CoreFoundation 0x2f58b175 __CFRunLoopRun + 1300
24 CoreFoundation 0x2f4f5ebf CFRunLoopRunSpecific + 522
25 CoreFoundation 0x2f4f5ca3 CFRunLoopRunInMode + 106
26 GraphicsServices 0x343fb663 GSEventRunModal + 138
27 UIKit 0x31e4214d UIApplicationMain + 1136
28 Branch 0x1a6437 main (main.m:14)
29 libdyld.dylib 0x3a27fab7 start + 2

最佳答案

您在使用 ARC 吗? MagicalRecord 使用 ARC 吗?

您或 MagicalRecord 过度释放了 NSAutoreleasePool 认为它拥有的某个对象。然后池被弹出(当您的 NSManagedObjectContext 完成保存:操作时)并且其中的一个对象是垃圾。尝试在启用 NSZombies 的情况下运行,或使用 Allocations Instrument 来确定哪个对象被过度释放。

关于ios - 魔法记录崩溃: NSManagedObjectContext Queue EXC_BAD_ACCESS KERN_INVALID_ADDRESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36611370/

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