- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的基于日历的应用程序中,我面临着来自应用程序商店构建的大量崩溃。但是,我无法重现,也没有遇到开发过程中的崩溃。
来自 Fabric 的崩溃日志:
-[EKEventStore(Utils) calendarByRetrievingSafelyWithIdentifier:forEntityType:]
Crashed: NSOperationQueue 0x17403fd60 :: NSOperation 0x17425bfc0 (QOS: DEFAULT)
0 CoreFoundation 0x19179b5d8 -[__NSDictionaryM setObject:forKey:] + 476
1 EventKit 0x19ab2a0d8 -[EKObject relationForKey:] + 216
2 EventKit 0x19ab859d4 -[EKCalendar source] + 24
3 EventKit 0x19ab9d718 -[EKEventStore calendarsForEntityType:] + 512
4 SampleApp 0x100112554 -[EKEventStore(Utils) calendarByRetrievingSafelyWithIdentifier:forEntityType:] (MySampleCalendarStore.m:4767)
5 SampleApp 0x1001d3f88 -[MyCalendarDataStore syncCalendarItems:startDate:endDate:completion:] (MyCalendarDataStore.m:84)
6 SampleApp 0x1000f4e58 __62-[MySampleAppStore syncDeviceCalendarsAndItems:withCompletion:]_block_invoke.1043 (MySampleCalendarStore.m:2499)
7 Foundation 0x19237e754 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8 Foundation 0x1922c32c8 -[NSBlockOperation main] + 96
9 Foundation 0x1922b38c4 -[__NSOperationInternal _start:] + 620
10 Foundation 0x192380b00 __NSOQSchedule_f + 228
11 libdispatch.dylib 0x1907451c0 _dispatch_client_callout + 16
12 libdispatch.dylib 0x190753444 _dispatch_queue_serial_drain + 928
13 libdispatch.dylib 0x1907489a8 _dispatch_queue_invoke + 652
14 libdispatch.dylib 0x19075538c _dispatch_root_queue_drain + 572
15 libdispatch.dylib 0x1907550ec _dispatch_worker_thread3 + 124
16 libsystem_pthread.dylib 0x19094e2b8 _pthread_wqthread + 1288
17 libsystem_pthread.dylib 0x19094dda4 start_wqthread + 4
我想解决这个崩溃问题,我上周在所有论坛上都尝试过。我找不到任何有用的线索来解决我的问题。请指导我手动重现此类崩溃并帮助解决。
我的代码:
NSOperationQueue *calendarDataStoresQueue = [[NSOperationQueue alloc] init];
for (EKCalendar *calendar in calendars) {
[calendarDataStoresQueue addOperationWithBlock:^{
MyCalendarDataStore *calendarDataStore = [[MyCalendarDataStore alloc] initWithCalendar:[[MYCalendar alloc] initWithInfoOfEventKitCalendar:calendar] eventStore:weakSelf.eventStore];
[calendarDataStore syncCalendarItems:items startDate:syncFrom endDate:syncTo completion:^{
complition()
}];
}];
}
我的实用工具:
@implementation EKEventStore (Utils)
- (EKCalendar*)calendarByRetrievingSafelyWithIdentifier:(NSString *)identifier forEntityType:(EKEntityType)entityType {
EKCalendar *calendar;
NSArray *calendars = [self calendarsForEntityType:entityType];
for (EKCalendar *aCalendar in calendars) {
if([aCalendar.calendarIdentifier isEqualToString:identifier]) {
calendar = aCalendar;
break;
}
}
return calendar;
}
@end
提前致谢
最佳答案
您没有发布足够的信息;你在 -[EKObject relationForKey:] 方法内的某个地方发生了崩溃;更重要的是,您还没有发布崩溃的确切原因;
在我看来,这个方法 [EKObject relationForKey:] 在某个地方从自身生成 dict,并且可能是 [__NSDictionaryM setObject:forKey:] 在这里你尝试将 nil 插入 dict
关于ios - 如何调试和重现 `NSOperationQueue`崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40743107/
我在 crashlytics 中得到了一些我完全不明白的崩溃报告,这是崩溃线程的崩溃日志: 我没有找到任何关于我的代码的提示,它也不是可重现的或只发生在特定设备上的东西。根据 Crashlytics
我需要从 JSON 下载数据,并将数据分配给 NSOperationQueue 之外的 NSData。这是我的代码: -(void)parsingInfo { NSURL *url = [NS
我有一个应用程序,其中一个长时间运行的进程(> 1 分钟)被放置在 NSOperationQueue(队列 A)上。当队列 A 操作运行时,UI 完全响应,完全符合预期。 但是,我有一种用户可以执行的
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 1年前关闭。 Improve this
我有几个后台任务需要处理,同时仍保持 UI 响应。我开始走上创建和管理线程的道路,但很快就遇到了 NSOperations。听起来是一个更好的解决方案。 。 . 但是,我似乎无法获得对 NSOpera
我想知道释放 ivar NSOperationQueue 的正确方法是什么,以防它仍有一些操作正在运行,这种情况通常在用户突然退出应用程序时发生。在一些示例中,我看到使用了 waitUntilAllO
我正在努力解决这个问题,所以我的问题是: 当我像这样实例化 NSOperationQueue 时: NSOperationQueue * operationQueue = [[NSOperationQ
我第一次尝试基于 Swift/NSOperationQueue 的设计,我正在尝试找出如何维护跨队列的数据完整性。 我处于设计过程的早期阶段,但该架构可能会涉及一个队列(称为sensorQ),用于处理
我正在寻找一种重新排序 NSOperationQueue 的方法。 我可以取消所有操作并按照我想要的顺序将它们扔回去,但我希望有一些更干净的东西。有什么想法吗? 最佳答案 NSOperationQue
我是iPhone新手。在哪里可以找到NSOperationQueue和NSOperation的示例?NSOperationQueue和NSOperation与线程相比有什么优势? 谢谢 最佳答案 阅读
正如 NSOperationQueue 类引用所述:在 iOS 中,操作队列不使用 Grand Central Dispatch 来执行操作。它们为非并发操作创建单独的线程,并从当前线程启动并发操作。
我创建了一个NSOperationQueue子类,将maxConcurrentOperations设置为1,并将addOperation方法重写为以下内容: -(void)addOperation:(
我一直在使用 NSOperationQueue,但我遇到了非常奇怪的内存问题。我已经尝试将问题减少到最简单的问题,在这里我得到了: 在初始化中: _queue = [[NSOperationQueue
我最近开始学习 Swift 中的多线程,我想使用 NSOperationQueue 和 NSOperation 类尝试一些基本的多线程。 在 .swift 文件的全局范围内(在 Xcode 中的命令行
我的任务是清理项目中一些现有的 Swift 代码,这些代码刚刚转换为 Swift 3。但是,我不断看到这个对我来说看起来很可疑的代码。 OperationQueue().addOperation(so
我正在开发一个应用程序,该应用程序从使用 performSelectorInBackground 启动的单独线程中的循环调用 AudioServicesPlayAlertSound(kSystemSo
我在我的应用程序中使用了 NSOperation 子类,它将在单个操作中执行以下 4 个任务,我希望所有这 4 个任务都在后台线程上运行,所以我将其封装到单个 NSOperation 类,这样我就可以
我在暂停当前正在执行的任务时遇到问题,我尝试设置 NSOperationQueue setSuspended=YES 暂停和 setSuspended=NO恢复进程。 根据 apple docs我不能
我正在使用 NSOperationQueue 执行并发下载并插入到核心数据中。 下面是代码,我正在使用 if(nil==queue) { queue=[[NSOperationQueue al
我正在为 ios 进行调整(显示来自网络的一些图像),并且我正在尝试使用 NSOperationQueue。首先,我在主线程上运行了一些代码来看看它是什么样子。显示每个图像持续了 ±5 秒(UI 卡住
我是一名优秀的程序员,十分优秀!