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 (iOS7) Animating and Intercepting Events Image Based Animation

Image Based Animation Error while running Crystal Ball program

I'm getting this error. Hope you can help me figure this out

import <UIKit/UIKit.h>

import "JFAppDelegate.h"

int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([JFAppDelegate class])); } }

6 Answers

Stone Preston
Stone Preston
42,016 Points

ok you most likely added your imageView to the storyboard, connected it as an outlet, and then after it was connection changed the name. Here is what you need to do.

go to your header file and remove the outlet declaration of the backgroundimageview.

then go to your storyboard file and select your view controller. then open up the outlets inspector (its the furthest button on the utilities pane that looks like an arrow with a circle around it). find the imageView outlet and remove it by clicking the x button.

then control click and drag from the image view in your storyboard to the header file. name it whatever name you used to reference it in your code (backgroundImageView most likely)

Stone Preston
Stone Preston
42,016 Points

open the console once your app crashes, scroll up and down looking for more info , there should be more information that tells you exactly whats causing the crash. post what you find

This is the highlighted code when it crashes

return UIApplicationMain(argc, argv, nil, NSStringFromClass([JFAppDelegate class]));

Stone Preston
Stone Preston
42,016 Points

I know, but that doesnt tell me anything about the error really. there is most likely an error message in the debug console. copy and paste whats in the console

I'm sorry I'm not sure what you mean by console. All I see is on the right hand side saying "Thread 1: signal SIGABRT".

Stone Preston
Stone Preston
42,016 Points

the console is the panel that comes up at the bottom of the xcode screen whenever you run your app. on the bottom right of the console panel there should be a log that displays error message. croll down and see if there is any more information after Thread 1: signal SIGABRT".

Thanks! Here's what i have...

2014-09-07 23:51:23.813 Crystal Ball[8565:60b] CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000 2014-09-07 23:51:23.815 Crystal Ball[8565:60b] Could not load the "" image referenced from a nib in the bundle with identifier "com.busterlabs.Crystal-Ball" 2014-09-07 23:51:23.820 Crystal Ball[8565:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<JFViewController 0x8dbc8c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key backgroundimageview.' *** First throw call stack: ( 0 CoreFoundation 0x017ef1e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x0156e8e5 objc_exception_throw + 44 2 CoreFoundation 0x0187efe1 -[NSException raise] + 17 3 Foundation 0x0122ed9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 4 Foundation 0x0119b1d7 _NSSetUsingKeyValueSetter + 88 5 Foundation 0x0119a731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 6 Foundation 0x011fcb0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 7 UIKit 0x004e51f4 -[UIRuntimeOutletConnection connect] + 106 8 libobjc.A.dylib 0x015807de -[NSObject performSelector:] + 62 9 CoreFoundation 0x017ea76a -[NSArray makeObjectsPerformSelector:] + 314 10 UIKit 0x004e3d4d -[UINib instantiateWithOwner:options:] + 1417 11 UIKit 0x0034c6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 12 UIKit 0x0034ce9d -[UIViewController loadView] + 302 13 UIKit 0x0034d0d3 -[UIViewController loadViewIfRequired] + 78 14 UIKit 0x0034d5d9 -[UIViewController view] + 35 15 UIKit 0x0026d267 -[UIWindow addRootViewControllerViewIfPossible] + 66 16 UIKit 0x0026d5ef -[UIWindow _setHidden:forced:] + 312 17 UIKit 0x0026d86b -[UIWindow _orderFrontWithoutMakingKey] + 49 18 UIKit 0x002783c8 -[UIWindow makeKeyAndVisible] + 65 19 UIKit 0x00228bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097 20 UIKit 0x0022d667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 21 UIKit 0x00241f92 -[UIApplication handleEvent:withNewEvent:] + 3517 22 UIKit 0x00242555 -[UIApplication sendEvent:] + 85 23 UIKit 0x0022f250 _UIApplicationHandleEvent + 683 24 GraphicsServices 0x037e4f02 _PurpleEventCallback + 776 25 GraphicsServices 0x037e4a0d PurpleEventCallback + 46 26 CoreFoundation 0x0176aca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53 27 CoreFoundation 0x0176a9db __CFRunLoopDoSource1 + 523 28 CoreFoundation 0x0179568c __CFRunLoopRun + 2156 29 CoreFoundation 0x017949d3 CFRunLoopRunSpecific + 467 30 CoreFoundation 0x017947eb CFRunLoopRunInMode + 123 31 UIKit 0x0022cd9c -[UIApplication _run] + 840 32 UIKit 0x0022ef9b UIApplicationMain + 1225 33 Crystal Ball 0x0000463d main + 141 34 libdyld.dylib 0x01e36701 start + 1 35 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Amazing! Thanks, I was able to debug