title: Xcode 6 Swift Converting String to Int in textfields
body: <p>so i have been stuck with this problem for a very long time now and i cannot figure it out.</p>
  
  <p>so my basic idea is that i have 2 textfields, where the user puts in a number (i don't know how to open the keypad yet would be nice if someone knew how) in both textfields and i want to divide those to numbers by each other.</p>
  
  <p>&lt; Label.text = (Textfield1.text) / (Textfield2.text) ></p>
  
  <p>so i got 3 variables, a label, and two textfields, but i keeps giving me this error that string isn't convertible to a UIint8.</p>
  
  <p>here is a screenshot with the code</p>
  
  <p><img src="https://i.imgur.com/Wd8GbuR.png" alt="enter image description here"></p>
  
  <p>here is the storyboard</p>
  
  <p><img src="https://i.stack.imgur.com/BcDC4.png" alt="enter image description here">
  PS: i am kinda new to this Xcode, so the problem might be REALLY obvious :/</p>
  
  <p>here is the error code (it gave me an error when i did it without</p>
  
  <p>let answer2 = textfield1.text.toInt()! / textfield2.text.toInt()!</p>
  
  <p>2014-09-12 15:16:05.764 lb[3107:261572] <strong>* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ButtonO.'
  *</strong> First throw call stack:
  (
      0   CoreFoundation                      0x000000010f2fb3e5 <strong>exceptionPreprocess + 165
      1   libobjc.A.dylib                     0x0000000110e11967 objc_exception_throw + 45
      2   CoreFoundation                      0x000000010f2fb029 -[NSException raise] + 9
      3   Foundation                          0x000000010f713383 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
      4   CoreFoundation                      0x000000010f2453f0 -[NSArray makeObjectsPerformSelector:] + 224
      5   UIKit                               0x000000010fe4716d -[UINib instantiateWithOwner:options:] + 1506
      6   UIKit                               0x000000010fca9d78 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
      7   UIKit                               0x000000010fcaa368 -[UIViewController loadView] + 109
      8   UIKit                               0x000000010fcaa5d9 -[UIViewController loadViewIfRequired] + 75
      9   UIKit                               0x000000010fcaaa6e -[UIViewController view] + 27
      10  UIKit                               0x000000010fbcb2b1 -[UIWindow addRootViewControllerViewIfPossible] + 58
      11  UIKit                               0x000000010fbcb64a -[UIWindow _setHidden:forced:] + 276
      12  UIKit                               0x000000010fbd7a81 -[UIWindow makeKeyAndVisible] + 42
      13  UIKit                               0x000000010fb825cd -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2628
      14  UIKit                               0x000000010fb8529c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350
      15  UIKit                               0x000000010fb84168 -[UIApplication workspaceDidEndTransaction:] + 179
      16  FrontBoardServices                  0x0000000112665513 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
      17  CoreFoundation                      0x000000010f230aac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK</strong> + 12
      18  CoreFoundation                      0x000000010f2267f5 __CFRunLoopDoBlocks + 341
      19  CoreFoundation                      0x000000010f2265b5 __CFRunLoopRun + 2389
      20  CoreFoundation                      0x000000010f2259f6 CFRunLoopRunSpecific + 470
      21  UIKit                               0x000000010fb83bdf -[UIApplication _run] + 413
      22  UIKit                               0x000000010fb86990 UIApplicationMain + 1282
      23  lb                                  0x000000010edb6e5e top_level_code + 78
      24  lb                                  0x000000010edb6e9a main + 42
      25  libdyld.dylib                       0x00000001113b3145 start + 1
      26  ???                                 0x0000000000000001 0x0 + 1
  )
  libc++abi.dylib: terminating with uncaught exception of type NSException
  (lldb) </p>