Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Improving Our User Interface Adding a Pop of Color

Hi, I follow your instructions, but when it comes to change the color of the text in the button, I get a message error..

*error message

My code is the same as the one in the video, but then I get an error message that says : thread 1: SIGABRT...

Here is the error rapport :

2015-06-04 23:32:14.054 FunFact[7465:922654] Unknown class ViewController in Interface Builder file. 2015-06-04 23:32:14.063 FunFact[7465:922654] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIView 0x7f93b1d285d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key funFactButton.' *** First throw call stack: ( 0 CoreFoundation 0x0000000109d24c65 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010b88fbb7 objc_exception_throw + 45 2 CoreFoundation 0x0000000109d248a9 -[NSException raise] + 9 3 Foundation 0x000000010a142b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 UIKit 0x000000010a6436be -[UIView(CALayerDelegate) setValue:forKey:] + 149 5 CoreFoundation 0x0000000109c6cd50 -[NSArray makeObjectsPerformSelector:] + 224 6 UIKit 0x000000010a89b52b -[UINib instantiateWithOwner:options:] + 1506 7 UIKit 0x000000010a6f3718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 8 UIKit 0x000000010a6f3d08 -[UIViewController loadView] + 109 9 UIKit 0x000000010a6f3f79 -[UIViewController loadViewIfRequired] + 75 10 UIKit 0x000000010a6f440e -[UIViewController view] + 27 11 UIKit 0x000000010a60f2c9 -[UIWindow addRootViewControllerViewIfPossible] + 58 12 UIKit 0x000000010a60f68f -[UIWindow _setHidden:forced:] + 247 13 UIKit 0x000000010a61be21 -[UIWindow makeKeyAndVisible] + 42 14 UIKit 0x000000010a5bf457 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732 15 UIKit 0x000000010a5c21de -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349 16 UIKit 0x000000010a5c10d5 -[UIApplication workspaceDidEndTransaction:] + 179 17 FrontBoardServices 0x000000010d39f5e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21 18 CoreFoundation 0x0000000109c5841c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 19 CoreFoundation 0x0000000109c4e165 __CFRunLoopDoBlocks + 341 20 CoreFoundation 0x0000000109c4df25 __CFRunLoopRun + 2389 21 CoreFoundation 0x0000000109c4d366 CFRunLoopRunSpecific + 470 22 UIKit 0x000000010a5c0b42 -[UIApplication _run] + 413 23 UIKit 0x000000010a5c3900 UIApplicationMain + 1282 24 FunFact 0x000000010974f557 main + 135 25 libdyld.dylib 0x000000010bfe7145 start + 1 26 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

Please help me :-)

3 Answers

Chris Adamson
Chris Adamson
132,143 Points

That is a lot of error log, do you have the code you were trying to execute?

Sure !

@IBOutlet weak var funFactButton: UIButton!

@IBAction func PushMe(sender: AnyObject) {
    var randomColor = colorWheel.randomColor()
    view.backgroundColor = randomColor
  funFactButton.tintColor = colorWheel.randomColor()
   TexteChange.text = factBook.randomFact()

}
Steven Jemmott
Steven Jemmott
8,109 Points

Check you interface builder for the UIButton object. I suspect either the name of the property was changed without deleting the previous instance OR the UIButton isn't connected to the object in Interface Builder.