2015-07-05 103 views
0

任何人都可以幫助我理解爲什麼我得到這個錯誤?這似乎在我加載我的視圖控制器之一時發生,但我不明白爲什麼。SIGABRT錯誤swift

什麼通常會導致這樣的錯誤?

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits length]: unrecognized selector sent to instance 0x7fbf924828a0' 
*** First throw call stack: 
(
    0 CoreFoundation      0x000000010664ac65 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x0000000105f27bb7 objc_exception_throw + 45 
    2 CoreFoundation      0x00000001066520ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 
    3 CoreFoundation      0x00000001065a813c ___forwarding___ + 988 
    4 CoreFoundation      0x00000001065a7cd8 _CF_forwarding_prep_0 + 120 
    5 libswiftCore.dylib     0x0000000107ddf728 _TTSf4g_d___TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 120 
    6 libswiftCore.dylib     0x0000000107dc01a3 _TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 19 
    7 Project1       0x00000001054ec3bd _TToFC8ASA_Rank22SettingsViewControllers9ASANumberSS + 61 
    8 Foundation       0x0000000105abdb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 
    9 CoreFoundation      0x0000000106592d50 -[NSArray makeObjectsPerformSelector:] + 224 
    10 UIKit        0x0000000106d1b4eb -[UINib instantiateWithOwner:options:] + 1506 
    11 UIKit        0x0000000106b736d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 
    12 UIKit        0x0000000106b73cc8 -[UIViewController loadView] + 109 
    13 UIKit        0x0000000106b73f39 -[UIViewController loadViewIfRequired] + 75 
    14 UIKit        0x0000000106b743ce -[UIViewController view] + 27 
    15 UIKit        0x000000010710132d -[_UIFullscreenPresentationController _setPresentedViewController:] + 65 
    16 UIKit        0x0000000106b4ed69 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105 
    17 UIKit        0x0000000106b80248 -[UIViewController _presentViewController:withAnimationController:completion:] + 1761 
    18 UIKit        0x0000000106b826c1 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132 
    19 UIKit        0x0000000106b825e5 -[UIViewController presentViewController:animated:completion:] + 229 
    20 UIKit        0x0000000106a44d62 -[UIApplication sendAction:to:from:forEvent:] + 75 
    21 UIKit        0x0000000106b5650a -[UIControl _sendActionsForEvents:withEvent:] + 467 
    22 UIKit        0x0000000106b558d9 -[UIControl touchesEnded:withEvent:] + 522 
    23 UIKit        0x0000000106a91958 -[UIWindow _sendTouchesForEvent:] + 735 
    24 UIKit        0x0000000106a92282 -[UIWindow sendEvent:] + 682 
    25 UIKit        0x0000000106a58541 -[UIApplication sendEvent:] + 246 
    26 UIKit        0x0000000106a65cdc _UIApplicationHandleEventFromQueueEvent + 18265 
    27 UIKit        0x0000000106a4059c _UIApplicationHandleEventQueue + 2066 
    28 CoreFoundation      0x000000010657e431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
    29 CoreFoundation      0x00000001065742fd __CFRunLoopDoSources0 + 269 
    30 CoreFoundation      0x0000000106573934 __CFRunLoopRun + 868 
    31 CoreFoundation      0x0000000106573366 CFRunLoopRunSpecific + 470 
    32 GraphicsServices     0x000000010a1e0a3e GSEventRunModal + 161 
    33 UIKit        0x0000000106a438c0 UIApplicationMain + 1282 
    34 Project1       0x00000001054f70c7 main + 135 
    35 libdyld.dylib      0x0000000108530145 start + 1 
    36 ???         0x0000000000000001 0x0 + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

請詢問任何其他信息是有幫助的

感謝

+0

的可能重複[什麼是空指針異常,以及如何解決?(http://stackoverflow.com/questions/218384/what-is-a-null-pointer-異常和如何-DO-I-FIX-IT) – TommySM

回答

3

你最有可能有一個分配給你轉換到該視圖控制器上的元素的出口不再連接到您的碼。這youtube視頻更詳細地解釋它。

要解決這個問題,請嘗試在助手編輯器打開的情況下右鍵單擊所有元素(UILabels,UIViews,UIButton ...)並交叉檢查以查看視圖控制器中是否引用了插座名稱。

Example