2016-01-20 74 views
0

在VC1中,一个按钮对VC2具有触发的继续动作。当我点击VC1中的按钮时,当我尝试调用超级应用程序时,该应用程序崩溃了对sendEvent的重写。为什么我的segue在重写的sendEvent上崩溃?

public class UIApplicationSub: UIApplication { 
    // properties here 

    override public func sendEvent(event: UIEvent) { 
      super.sendEvent(event) 
      // reset idle timer here 

我不能肯定,但是从崩溃报告低于它看起来像我得到当VC2被加载keyValueCoding错误,然而新的观点只是一些按钮,也没有对它们设置网点。

有关可能导致此故障的任何想法?

Incident Identifier: 35C240D4-60EF-41E9-B2F4-9A288806EFEF 
CrashReporter Key: 81571a82664994674b5d12cbd33bb0c911f5c23f 
Hardware Model:  iPhone6,1 
Version:    2.14 (8.00) 
Code Type:   ARM-64 (Native) 
Parent Process:  launchd [1] 

Date/Time:   2016-01-20 08:53:57.57 -0500 
Launch Time:   2016-01-20 08:53:41.41 -0500 
OS Version:   iOS 9.2 (13C75) 
Report Version:  105 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Exception Note: EXC_CORPSE_NOTIFY 
Triggered by Thread: 0 

Filtered syslog: 
None found 

Last Exception Backtrace: 
0 CoreFoundation     0x18186d900 __exceptionPreprocess + 124 
1 libobjc.A.dylib     0x180edbf80 objc_exception_throw + 56 
2 CoreFoundation     0x18186d5c0 -[NSException raise] + 12 
3 Foundation      0x182167f74 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 268 
4 UIKit       0x1868cff1c -[UIViewController setValue:forKey:] + 104 
5 UIKit       0x186c187cc -[UIRuntimeOutletCollectionConnection performConnect] + 908 
6 CoreFoundation     0x1817973ac -[NSArray makeObjectsPerformSelector:] + 232 
7 UIKit       0x186a296a0 -[UINib instantiateWithOwner:options:] + 1748 
8 UIKit       0x1868d333c -[UIViewController _loadViewFromNibNamed:bundle:] + 376 
9 UIKit       0x18669c250 -[UIViewController loadView] + 176 
10 UIKit       0x18655fd6c -[UIViewController loadViewIfRequired] + 144 
11 UIKit       0x18655fcc4 -[UIViewController view] + 28 
12 UIKit       0x186e2aca0 -[_UIFullscreenPresentationController _setPresentedViewController:] + 92 
13 UIKit       0x1868b70dc -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 136 
14 UIKit       0x1868dcc24 -[UIViewController _presentViewController:withAnimationController:completion:] + 3780 
15 UIKit       0x1868df9c0 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 472 
16 UIKit       0x186659cec -[UIViewController presentViewController:animated:completion:] + 184 
17 UIKit       0x186c847e4 __74-[UIStoryboardPresentationSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 144 
18 UIKit       0x186c8b63c -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 456 
19 UIKit       0x186c8b440 -[UIStoryboardSegueTemplate _perform:] + 92 
20 UIKit       0x186c8b708 -[UIStoryboardSegueTemplate perform:] + 160 
21 UIKit       0x186597e50 -[UIApplication sendAction:to:from:forEvent:] + 100 
22 UIKit       0x186597dcc -[UIControl sendAction:to:forEvent:] + 80 
23 UIKit       0x18657fa88 -[UIControl _sendActionsForEvents:withEvent:] + 416 
24 UIKit       0x1865976e4 -[UIControl touchesEnded:withEvent:] + 572 
25 UIKit       0x186597314 -[UIWindow _sendTouchesForEvent:] + 804 
26 UIKit       0x18658fe30 -[UIWindow sendEvent:] + 784 
27 UIKit       0x1865604cc -[UIApplication sendEvent:] + 248 
28 DigitalLife      0x100899420 UIApplicationSub.sendEvent(UIEvent) ->() (UIApplicationSub.swift:50) 
29 DigitalLife      0x10089999c @objc UIApplicationSub.sendEvent(UIEvent) ->() (UIApplicationSub.swift:0) 
30 UIKit       0x18655e794 _UIApplicationHandleEventQueue + 5528 
31 CoreFoundation     0x181824efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 
32 CoreFoundation     0x181824990 __CFRunLoopDoSources0 + 540 
33 CoreFoundation     0x181822690 __CFRunLoopRun + 724 
34 CoreFoundation     0x181751680 CFRunLoopRunSpecific + 384 
35 GraphicsServices    0x182c60088 GSEventRunModal + 180 
36 UIKit       0x1865c8d90 UIApplicationMain + 204 
37 DigitalLife      0x10031f334 main (main.swift:11) 
38 libdyld.dylib     0x1812f28b8 start + 4 


Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libsystem_kernel.dylib   0x0000000181410140 __pthread_kill + 8 
1 libsystem_pthread.dylib   0x00000001814d8ef8 pthread_kill + 112 
2 libsystem_c.dylib    0x0000000181381dac abort + 140 
3 DigitalLife      0x000000010095fce8 -[PLCrashReporter generateLiveReportWithThread:] + 0 
4 CoreFoundation     0x000000018186dc88 __handleUncaughtException + 652 
5 libobjc.A.dylib     0x0000000180edc23c _objc_terminate() + 112 
6 libc++abi.dylib     0x0000000180ecef44 std::__terminate(void (*)()) + 16 
7 libc++abi.dylib     0x0000000180eceb10 __cxa_rethrow + 144 
8 libobjc.A.dylib     0x0000000180edc120 objc_exception_rethrow + 44 
9 CoreFoundation     0x0000000181751728 CFRunLoopRunSpecific + 552 
10 GraphicsServices    0x0000000182c60088 GSEventRunModal + 180 
11 UIKit       0x00000001865c8d90 UIApplicationMain + 204 
12 DigitalLife      0x000000010031f334 main (main.swift:11) 
13 libdyld.dylib     0x00000001812f28b8 start + 4 
+0

你想发送什么样的事件到VC2?你想以编程方式移动到其他VC吗? –

+0

嗨亚伦。你可以点击触发问题的按钮,然后在Xcode检查器中检查连接。它显示按钮连接到什么? –

回答

0

我建议你点击造成问题的按钮,在Xcode中,单击连接检查。看看按钮连接到什么。

复制视图控制器并在故事板中重新使用它可能会导致类似的问题。有时与其他网点的连接也会被复制,并且在运行时会导致问题。

如果想法正确,请确保删除IBAction并写入一个新的并将其连接到按钮。

+0

为了补充说明 - 很可能您看到的问题来自VC2,而不是VC1。故事板中可能存在延迟的坏点。 – shortstuffsushi

+0

@shortstuffsushi再次感谢:) –

+0

这个问题绝对是在VC2中。一个按钮连接到一个不存在的插座。我猜我没有得到不符合keyValue,因为我重写了sendEvent。 –