此崩溃仅发生在 iOS 11 上,我不知道如何修复它。
当点击 iOS 11 的 EKCalendarChooser 类的新工具栏上的 [显示全部] 按钮时,会发生崩溃,但当其选择样式设置为 .single
时:
致命异常:NSInternalInconsistencyException 样式无效
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1830e3d38 __exceptionPreprocess
1 libobjc.A.dylib 0x1825f8528 objc_exception_throw
2 CoreFoundation 0x1830e3c0c +[NSException raise:format:]
3 Foundation 0x183a72c24 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 EventKitUI 0x1941ad908 -[EKCalendarChooser _selectAllCalendarsAndStores:]
5 EventKitUI 0x1941a6384 -[EKCalendarChooser showAllButtonPressed]
6 UIKit 0x18c52820c -[UIApplication sendAction:to:from:forEvent:]
7 UIKit 0x18c68253c -[UIBarButtonItem(UIInternal) _sendAction:withEvent:]
8 UIKit 0x18c52820c -[UIApplication sendAction:to:from:forEvent:]
9 UIKit 0x18c52818c -[UIControl sendAction:to:forEvent:]
10 UIKit 0x18c512f4c -[UIControl _sendActionsForEvents:withEvent:]
11 UIKit 0x18c5130b4 -[UIControl _sendActionsForEvents:withEvent:]
12 UIKit 0x18c527a80 -[UIControl touchesEnded:withEvent:]
13 UIKit 0x18cb73ec8 _UIGestureEnvironmentSortAndSendDelayedTouches
14 UIKit 0x18cb6f488 _UIGestureEnvironmentUpdate
15 CoreFoundation 0x18308b8b8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
16 CoreFoundation 0x183089270 __CFRunLoopDoObservers
17 CoreFoundation 0x18308982c __CFRunLoopRun
18 CoreFoundation 0x182faa2d8 CFRunLoopRunSpecific
19 GraphicsServices 0x184e3bf84 GSEventRunModal
20 UIKit 0x18c557880 UIApplicationMain
21 MyApp1 0x104d92be4 main (AppDelegate.swift:15)
22 libdyld.dylib 0x182ace56c start
我想知道有没有办法隐藏新的工具栏?
===== 2017 年 11 月 19 日编辑
添加屏幕截图以显示新工具栏:
一旦selectedCalendars
留空,就会显示新的工具栏。一旦点击[显示全部]按钮,就会发生崩溃。
最佳答案
我遇到了同样的错误,并发现了一种奇怪但令人惊讶的有效方法来解决它。事实证明,如果您在呈现 View Controller 之前清除选定的日历集,工具栏就会消失,从而防止崩溃。
calendarChooser.selectedCalendars = Set();
关于ios11 - iOS 11 在 EventKitUI 上崩溃 -[EKCalendarChooser _selectAllCalendarsAndStores :],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46699378/