我正在关注使用Swift创建iOS应用程序的Apple教程[开发iOS应用程序(Swift)],我完全按照原样执行每一步。这个应用程序在模拟器中一直运行良好,但突然它开始抛出SIGABRT错误(我做了一个简短的研究,以了解SIGABRT(信号中止)错误是什么,我甚至找到了一些其他答案,但没有似乎解决了我的问题。)
控制台输出:
2017-10-25 02:00:23.553 myApplication[1358:48276] -[SWRevealViewController revealToggel:]: unrecognized selector sent to instance 0x7ff74c813400 2017-10-25 02:00:23.824 myApplication[1358:48276] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SWRevealViewController revealToggel:]: unrecognized selector sent to instance 0x7ff74c813400' *** First throw call stack: ( 0 CoreFoundation 0x000000010a39ae65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000109e11deb objc_exception_throw + 48 2 CoreFoundation 0x000000010a3a348d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x000000010a2f090a ___forwarding___ + 970 4 CoreFoundation 0x000000010a2f04b8 _CF_forwarding_prep_0 + 120 5 UIKit 0x000000010a973194 -[UIApplication sendAction:to:from:forEvent:] + 92 6 UIKit 0x000000010ad747b7 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 152 7 UIKit 0x000000010a973194 -[UIApplication sendAction:to:from:forEvent:] + 92 8 UIKit 0x000000010aae26fc -[UIControl sendAction:to:forEvent:] + 67 9 UIKit 0x000000010aae29c8 -[UIControl _sendActionsForEvents:withEvent:] + 311 10 UIKit 0x000000010aae2b43 -[UIControl _sendActionsForEvents:withEvent:] + 690 11 UIKit 0x000000010aae1af8 -[UIControl touchesEnded:withEvent:] + 601 12 UIKit 0x000000010a9e249b -[UIWindow _sendTouchesForEvent:] + 835 13 UIKit 0x000000010a9e31d0 -[UIWindow sendEvent:] + 865 14 UIKit 0x000000010a991b66 -[UIApplication sendEvent:] + 263 15 UIKit 0x000000010a96bd97 _UIApplicationHandleEventQueue + 6844 16 CoreFoundation 0x000000010a2c6a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 17 CoreFoundation 0x000000010a2bc95c __CFRunLoopDoSources0 + 556 18 CoreFoundation 0x000000010a2bbe13 __CFRunLoopRun + 867 19 CoreFoundation 0x000000010a2bb828 CFRunLoopRunSpecific + 488 20 GraphicsServices 0x000000010f092ad2 GSEventRunModal + 161 21 UIKit 0x000000010a971610 UIApplicationMain + 171 22 myApplication 0x00000001098f224d main + 109 23 libdyld.dylib 0x000000010d2c392d start + 1 24 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
答案 0 :(得分:0)
错字?应该是ngOnInit(): void {
this.siteService.socket.on("users_online_now", function(usersOnlineNow){
this.usersOnlineNow = usersOnlineNow;
console.log(usersOnlineNow);
});
}
...
答案 1 :(得分:0)
我认为你拼错了Red []
view [
text "Value of x:" f1: field "" return
text "Value of y:" f2: field "" return
text "Read Sum:" tt: text "" return
button "Calculate" [
tt/text: to-string ((to-integer f1/text) + (to-integer f2/text)) ]
button "Quit" [quit] ]
。它应该是revealToggel:
。