Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. '[<UIViewController 0x7ff27051a5f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnRoll.'
  2. *** First throw call stack:
  3. (
  4. 0 CoreFoundation 0x0000000103744e65 __exceptionPreprocess + 165
  5. 1 libobjc.A.dylib 0x0000000105484deb objc_exception_throw + 48
  6. 2 CoreFoundation 0x0000000103744aa9 -[NSException raise] + 9
  7. 3 Foundation 0x0000000103b0d9bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
  8. 4 UIKit 0x00000001040f0320 -[UIViewController setValue:forKey:] + 88
  9. 5 UIKit 0x000000010431ef41 -[UIRuntimeOutletConnection connect] + 109
  10. 6 CoreFoundation 0x00000001036854a0 -[NSArray makeObjectsPerformSelector:] + 224
  11. 7 UIKit 0x000000010431d924 -[UINib instantiateWithOwner:options:] + 1864
  12. 8 UIKit 0x00000001040f6eea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
  13. 9 UIKit 0x00000001040f7816 -[UIViewController loadView] + 178
  14. 10 UIKit 0x00000001040f7b74 -[UIViewController loadViewIfRequired] + 138
  15. 11 UIKit 0x00000001040f82e7 -[UIViewController view] + 27
  16. 12 UIKit 0x0000000103fceab0 -[UIWindow addRootViewControllerViewIfPossible] + 61
  17. 13 UIKit 0x0000000103fcf199 -[UIWindow _setHidden:forced:] + 282
  18. 14 UIKit 0x0000000103fe0c2e -[UIWindow makeKeyAndVisible] + 42
  19. 15 UIKit 0x0000000103f59663 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
  20. 16 UIKit 0x0000000103f5fcc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
  21. 17 UIKit 0x0000000103f5ce7b -[UIApplication workspaceDidEndTransaction:] + 188
  22. 18 FrontBoardServices 0x0000000107319754 -[FBSSerialQueue _performNext] + 192
  23. 19 FrontBoardServices 0x0000000107319ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
  24. 20 CoreFoundation 0x0000000103670a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
  25. 21 CoreFoundation 0x000000010366695c __CFRunLoopDoSources0 + 556
  26. 22 CoreFoundation 0x0000000103665e13 __CFRunLoopRun + 867
  27. 23 CoreFoundation 0x0000000103665828 CFRunLoopRunSpecific + 488
  28. 24 UIKit 0x0000000103f5c7cd -[UIApplication _run] + 402
  29. 25 UIKit 0x0000000103f61610 UIApplicationMain + 171
  30. 26 Craps 0x00000001035652dd main + 109
  31. 27 libdyld.dylib 0x0000000105f8d92d start + 1
  32. )
  33. libc++abi.dylib: terminating with uncaught exception of type NSException
  34.  
  35. //
  36. // ViewController.swift
  37. // Craps
  38. //
  39. // Created by Lamido Tijjo on 2/11/16.
  40. // Copyright © 2016 YauwaSarki. All rights reserved.
  41. //
  42.  
  43. import UIKit
  44.  
  45.  
  46. class CrapsViewController: UIViewController {
  47.  
  48. var rollDice1: Int = 0
  49. var rollDice2: Int = 0
  50. var rollTotal: Int = 0
  51.  
  52. @IBOutlet var lblRollOne: UILabel!
  53. @IBOutlet var lblRollTwo: UILabel!
  54. @IBOutlet var lblTotalRoll: UILabel!
  55.  
  56. @IBAction func btnRollDice(sender: AnyObject) {
  57. rollDice1 = Int(arc4random() % 6) + 1
  58. rollDice2 = Int(arc4random() % 6) + 1
  59.  
  60. rollTotal = rollDice1 + rollDice2
  61. lblRollOne.text = String(rollDice1)
  62. lblRollTwo.text = String(rollDice2)
  63.  
  64. if rollTotal != 7 || rollTotal != 11 {
  65. lblTotalRoll.text = "Sorry you rolled a (rollTotal), please try again!"
  66. } else {
  67. lblTotalRoll.text = "Congrats! you rolled a (rollTotal), play again if you like!"
  68. }
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement