我的应用程序随机崩溃,我无法生成与用户设备中发生的相同情况,此处提供了崩溃报告中的更多详细信息:
碰撞等级:
NSInternalInconsistencyException
功能:
-[CalendarViewController deleteEvent:]
方法实现是这样的:
-(void) deleteEvent: (EKSpan ) span :(EKEvent *) eventToDelete{
NSError* error = nil;
[sharedEventStore removeEvent:eventToDelete span:span error:&error];
// refresh the UI
}
堆栈跟踪:
0 CoreFoundation 0x33acf2a3 <redacted> + 162
1 libobjc.A.dylib 0x3b7ec97f objc_exception_throw + 30
2 CoreFoundation 0x33acf15d <redacted> + 0
3 Foundation 0x343a4ab7 <redacted> + 90
4 EventKit 0x34208b33 <redacted> + 1642
5 EventKit 0x342084c1 <redacted> + 408
6 EventKit 0x342091f7 <redacted> + 306
7 EventKit 0x341fa199 <redacted> + 144
8 EventKit 0x341fa0ff <redacted> + 30
9 Calendar 0x0010acaf -[CalendarViewController deleteEvent:] + 126
10 Calendar 0x0016f585 -[BlockAlertView dismissWithClickedButtonIndex:animated:] + 196
11 UIKit 0x359c20c5 <redacted> + 72
12 UIKit 0x359c2077 <redacted> + 30
13 UIKit 0x359c2055 <redacted> + 44
14 UIKit 0x359c190b <redacted> + 502
15 UIKit 0x359c1e01 <redacted> + 488
16 UIKit 0x358ea5f1 <redacted> + 524
17 UIKit 0x358d7801 <redacted> + 380
18 UIKit 0x358d711b <redacted> + 6154
19 GraphicsServices 0x375ed5a3 <redacted> + 590
20 GraphicsServices 0x375ed1d3 <redacted> + 34
21 CoreFoundation 0x33aa4173 <redacted> + 34
22 CoreFoundation 0x33aa4117 <redacted> + 138
23 CoreFoundation 0x33aa2f99 <redacted> + 1384
24 CoreFoundation 0x33a15ebd CFRunLoopRunSpecific + 356
25 CoreFoundation 0x33a15d49 CFRunLoopRunInMode + 104
26 GraphicsServices 0x375ec2eb GSEventRunModal + 74
27 UIKit 0x3592b301 UIApplicationMain + 1120
28 Calendar 0x000f9533 main + 66
29 Calendar 0x0008a6a8 start + 40
请注意,我在单例模式中使用 EKEventStore 的一个实例:
// this is in separate class
static EKEventStore *eventStore = nil;
+ (EKEventStore *)getEventStoreInstance
{
if (eventStore == nil){
@synchronized(self){
if (eventStore == nil){
eventStore = [[EKEventStore alloc] init];
}
}
}
return(eventStore);
}
这次崩溃有什么可能的原因吗?