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

Not animating

ViewController.h: www.pastebin.com/ddW8ETj8 ViewController.m: www.pastebin.com/XMWLXs5w

Both CrystalBall Class files are working correctly (CrystalBall.h/CrystalBall.m) and are not related to this problem, the point is: The program compiles and runs on the simulator just fine, but when I click or shake it; it doesn't animate. It only changes the text. Do you guys know what I might have done wrong?

Oh, and the Main.storyboard background is linked to it alright. (Referencing outlets, right?)

Put a breakpoint in -makePrediction and see if it ever makes it to the method. Does it?

3 Answers

Thanks for your reply +Marshall Huss, and how do I exactly do that?

It does, together with it I used a NSLog(@"It works"); on the method implementation of makePrediction and it does work too.

The problem seems to be something related to the Main.storyboard and the animation framework itself I guess.

OK, make sure your UIImageView outlet is tied up correctly. To confirm, break in the -makePrediction method. When it stop you'll see the bottom of the screen pop up with variables on the left and console on the right.

Either expand self and make sure backgroundImageView is not nil. Alternatively you can type po self.backgroundImageView in the console.

The self (using the breakpoint) refers to this variables: UIVIewController, _predictionLabel,_crystalBal, and_backgroundImageView. On the self _backgroundImageView the storage option shows only a "[0]", I guess that's what you mean by a nil?

I'm afraid I can't help anymore unless I see the project. If you want to zip up the project and share a link I will take a look.