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
Cookie Monster
191 PointsCrystal Ball App - Error
So, I am working on the Crystal Ball app and I'm at the animation stage. When I try to run my app, it gives me the following error:
2013-07-06 18:57:22.215 CrystalBall[15489:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8987150> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key back.' *** First throw call stack: (0x1c92012 0x10cfe7e 0x1d1afb1 0xb7be41 0xafd5f8 0xafd0e7 0xb27b58 0x231019 0x10e3663 0x1c8d45a 0x22fb1c 0xf47e7 0xf4dc8 0xf4ff8 0xf5232 0x443d5 0x4476f 0x44905 0x4d917 0x1196c 0x1294b 0x23cb5 0x24beb 0x16698 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44 0x1c37e1b 0x1217a 0x13ffc 0x279d 0x26c5) libc++abi.dylib: terminate called throwing an exception
(lldb)
I didn't see this error before adding in the code. Has anyone faced this issue/know what to do?
My code is the same as the one in the video, so I'm not sure what is going wrong. I can supply my code if needed.
Thank you!
1 Answer
August Whitlock
Courses Plus Student 1,685 PointsYes, If you can supply the code, that would be great. I'm currently working through that exact project--in fact I'm almost done with it--and I haven't experienced that error just yet. I've gotten to the "Shake things up" portion--and I'm loving it, and I have a lot of great idea on how to improve the app as well. But any rate, I did run into an error when adding new code to the project through the various phases. These was no real error, just a self terminating condition that didn't allow the emulator to run the project. But that was solved by rebooting Eclipse.
But lets have a look see at the code you have written so far.
Cookie Monster
191 PointsCookie Monster
191 PointsOh, how can I reboot Eclipse?
Here is my ViewController.m file code (sorry about the formatting):
Amit Bijlani
Treehouse Guest TeacherAmit Bijlani
Treehouse Guest TeacherIt's possible there's something wrong in your StoryBoard and how you have wired your Outlets or Actions. I would say delete and re-create them
Cookie Monster
191 PointsCookie Monster
191 PointsThank you so much! I deleted and re-created the outlets and now my app is running again!
However, my animation is not working (before I had the error and after I fixed it). I still can see the prediction pop up, but the animation cycle does not run. I added this code to see if the animation was running:
if (self.imageView.isAnimating) { NSLog(@"animation running"); }
This logged the statement "animation running," but I can't see the animation.
Could you let me know what is wrong? I have copied my ViewController.m file above.
Amit Bijlani
Treehouse Guest TeacherAmit Bijlani
Treehouse Guest TeacherCould it be that you added a background image using the storyboard as well as in your code within the
viewDidLoadmethod? You should have either one of them, otherwise one will hide the other.Cookie Monster
191 PointsCookie Monster
191 PointsI deleted the background image from within the viewDidLoad method and it solved my problem! Thank you so much!