我是iOS新手,使用swift。我的代码崩溃了NSInternalInconsistencyException,但我不确定为什么会发生这种情况以及如何跟踪问题。这是堆栈跟踪。
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1869111b8 __exceptionPreprocess
1 libobjc.A.dylib 0x18534855c objc_exception_throw
2 CoreFoundation 0x18691108c +[NSException raise:format:]
3 Foundation 0x1873c902c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18cfcdae0 -[UIPageViewController queuingScrollView:didEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:]
5 UIKit 0x18d09fcbc -[_UIQueuingScrollView _notifyDelegateDidEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:]
6 UIKit 0x18d09fa14 __78-[_UIQueuingScrollView _enqueueAnimatedScrollInDirection:withView:completion:]_block_invoke.299
7 UIKit 0x18d09bb38 -[_UITransitionState cleanupWithFinishedState:completedState:]
8 UIKit 0x18d09e7b8 -[_UIQueuingScrollView _cleanUpCompletionState:didFinish:didComplete:]
9 UIKit 0x18d09ec58 -[_UIQueuingScrollView _enqueueAnimatedScrollInDirection:withView:completion:]
10 UIKit 0x18d09ff0c -[_UIQueuingScrollView setView:direction:animated:completion:]
11 UIKit 0x18cfcac10 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:]
12 UIKit 0x18cfccb48 -[UIPageViewController _handlePagingInDirection:completion:]
13 UIKit 0x18cfce714 -[UIPageViewController _pageControlValueChanged:]
14 UIKit 0x18c7f4d30 -[UIApplication sendAction:to:from:forEvent:]
15 UIKit 0x18c7f4cb0 -[UIControl sendAction:to:forEvent:]
16 UIKit 0x18c7df128 -[UIControl _sendActionsForEvents:withEvent:]
17 UIKit 0x18cc8c1dc -[UIPageControl endTrackingWithTouch:withEvent:]
18 UIKit 0x18c7f4558 -[UIControl touchesEnded:withEvent:]
19 UIKit 0x18c7f40c4 -[UIWindow _sendTouchesForEvent:]
20 UIKit 0x18c7ef328 -[UIWindow sendEvent:]
21 UIKit 0x18c7bfda0 -[UIApplication sendEvent:]
22 UIKit 0x18cfa975c __dispatchPreprocessedEventFromEventQueue
23 UIKit 0x18cfa3130 __handleEventQueue
24 CoreFoundation 0x1868beb5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
25 CoreFoundation 0x1868be4a4 __CFRunLoopDoSources0
26 CoreFoundation 0x1868bc0a4 __CFRunLoopRun
27 CoreFoundation 0x1867ea2b8 CFRunLoopRunSpecific
28 GraphicsServices 0x18829e198 GSEventRunModal
29 UIKit 0x18c82a7fc -[UIApplication _run]
30 UIKit 0x18c825534 UIApplicationMain
31 MY FIRST APPLICATION 0x10021a774 main (AppDelegate.swift:14)
32 libdispatch.dylib 0x1857cd5b8 (Missing)
只有我在此堆栈跟踪中知道的代码是AppDelegate.swift:14,即
class AppDelegate: UIResponder, UIApplicationDelegate {