gpt4 book ai didi

ios - "[EKObjectID entityName]"崩溃

转载 作者:行者123 更新时间:2023-11-29 10:50:55 25 4
gpt4 key购买 nike

我们在野外遇到过这种崩溃,当然我们不能在本地进行 repo 。它似乎只发生在 ios 7 上。它是一个 NSInternalInconsistencyException 的事实告诉我们这是一个内部 NSAssertion 错误。任何防止这种情况发生的想法都将不胜感激。

这是堆栈跟踪:

Thread : Fatal Exception: NSInternalInconsistencyException, 
Unknown entity type while trying to create an object ID

0 CoreFoundation 0x2d69bf4b __exceptionPreprocess + 130
1 libobjc.A.dylib 0x37a2b6af objc_exception_throw + 38
2 CoreFoundation 0x2d69be25 +[NSException raise:format:]
3 Foundation 0x2e043fe3 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 90
4 EventKit 0x2ddf2e2b -[EKObjectID entityName] + 202
5 EventKit 0x2ddf2c65 -[EKEventStore _addFetchedObjectWithID:] + 56
6 EventKit 0x2ddf2c0d __78-[EKEventStore registerFetchedObjectWithID:withDefaultLoadedProperties:inSet:]_block_invoke + 80
7 libdispatch.dylib 0x37f0ed07 _dispatch_client_callout + 22
8 libdispatch.dylib 0x37f20e73 _dispatch_barrier_sync_f_invoke + 26
9 EventKit 0x2ddf2b05 -[EKEventStore registerFetchedObjectWithID:withDefaultLoadedProperties:inSet:] + 156
10 EventKit 0x2ddfa371 __41-[EKPredicateSearch startWithCompletion:]_block_invoke + 652
11 EventKit 0x2ddfa001 -[EKDaemonConnection _processReplyWithID:data:finished:] + 264
12 EventKit 0x2ddf9ef3 CADReceiveReply + 98
13 EventKit 0x2ddf9e5f _XReply + 102
14 EventKit 0x2ddf9dd5 ClientCallbacks_server + 64
15 libdispatch.dylib 0x37f11a9d dispatch_mig_server$VARIANT$up + 312
16 EventKit 0x2ddf9d6d __43-[EKDaemonConnection initWithOptions:path:]_block_invoke16 + 40
17 libdispatch.dylib 0x37f0f057 _dispatch_source_invoke$VARIANT$up + 258
18 libdispatch.dylib 0x37f218f9 _dispatch_root_queue_drain + 76
19 libdispatch.dylib 0x37f21b79 _dispatch_worker_thread2 + 56
20 libsystem_pthread.dylib 0x38050dbf _pthread_wqthread + 298
21 libsystem_pthread.dylib 0x38050c84 start_wqthread + 8

最佳答案

这个错误的原因似乎与我们试图在我们的应用程序中获取多少事件有关。这是我对苹果错误报告(15424747)的回复。

当我们的应用程序确实对具有大范围日期的 eventStore 进行谓词时,似乎会引入此错误。这是代码:

NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate   endDate:endDate calendars:nil]; 
if (!self.masterListSortDescriptor) {
self.masterListSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"startDate" ascending:YES];
}
NSArray *result = [[self.eventStore eventsMatchingPredicate:predicate] sortedArrayUsingDescriptors:@[self.masterListSortDescriptor]];

如果开始日期 = 今天 - 1 年且结束日期 = 今天 + 2 年,则此代码块将失败。我们通过将范围缩小到 startDate = Today - 6 months 和 endDate = Today + 1 year 来“解决”这个问题,并且这个错误从我们的崩溃日志中消失了。

关于ios - "[EKObjectID entityName]"崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20480282/

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