ios - Thread:1 Signal SIGAGBRT -


why thread:1 signal sigagbrt within code? don't know change fix error. application starts , press button app cancels out , gives me error.

import uikit  class viewcontroller: uiviewcontroller {      @iboutlet var textfieldinput: uitextfield!     @iboutlet var lacelsius: uilabel!     @iboutlet var lafahrenheit: uilabel!      override func viewdidload() {         super.viewdidload()         // additional setup after loading view, typically nib.     }      override func didreceivememorywarning() {         super.didreceivememorywarning()         // dispose of resources can recreated.     }       @ibaction func btn(sender: uibutton) {          var c_out = 0.0         var f_out = 0.0         var inputvalue = 0.0          let textinput = nsstring(string: textfieldinput.text!)         inputvalue = textinput.doublevalue          c_out = (inputvalue-32)*5/9         f_out = inputvalue * 1.8 + 32          self.lacelsius.text = nsstring(format: "%3.2f" ,c_out) string         self.lafahrenheit.text = nsstring(format: "%3.2f" ,f_out) string      }  } 

this error code:

 2016-09-22 14:15:51.669 degreecl[19045:1774964] -[degreecl.viewcontroller btnpressed:]: unrecognized selector sent instance 0x7fa7bb643d40 2016-09-22 14:15:51.674 degreecl[19045:1774964] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[degreecl.viewcontroller btnpressed:]: unrecognized selector sent instance 0x7fa7bb643d40' *** first throw call stack: (     0   corefoundation                      0x000000010de1dd85 __exceptionpreprocess + 165     1   libobjc.a.dylib                     0x000000010fbc1deb objc_exception_throw + 48     2   corefoundation                      0x000000010de26d3d -[nsobject(nsobject) doesnotrecognizeselector:] + 205     3   corefoundation                      0x000000010dd6ccfa ___forwarding___ + 970     4   corefoundation                      0x000000010dd6c8a8 _cf_forwarding_prep_0 + 120     5   uikit                               0x000000010e647a8d -[uiapplication sendaction:to:from:forevent:] + 92     6   uikit                               0x000000010e7bae67 -[uicontrol sendaction:to:forevent:] + 67     7   uikit                               0x000000010e7bb143 -[uicontrol _sendactionsforevents:withevent:] + 327     8   uikit                               0x000000010e7ba263 -[uicontrol touchesended:withevent:] + 601     9   uikit                               0x000000010e6ba99f -[uiwindow _sendtouchesforevent:] + 835     10  uikit                               0x000000010e6bb6d4 -[uiwindow sendevent:] + 865     11  uikit                               0x000000010e666dc6 -[uiapplication sendevent:] + 263     12  uikit                               0x000000010e640553 _uiapplicationhandleeventqueue + 6660     13  corefoundation                      0x000000010dd43301 __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 17     14  corefoundation                      0x000000010dd3922c __cfrunloopdosources0 + 556     15  corefoundation                      0x000000010dd386e3 __cfrunlooprun + 867     16  corefoundation                      0x000000010dd380f8 cfrunlooprunspecific + 488     17  graphicsservices                    0x00000001124b3ad2 gseventrunmodal + 161     18  uikit                               0x000000010e645f09 uiapplicationmain + 171     19  degreecl                            0x000000010dc38412 main + 114     20  libdyld.dylib                       0x000000011068592d start + 1     21  ???                                 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception (lldb)  

the crucial information is

[degreecl.viewcontroller btnpressed:]: unrecognized selector sent instance ...'

that means in interface builder there somewhere dead connection action btnpressed. remove it.

you can search btnpressed ⇧⌘f.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -