Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Simple iPhone App (iOS7) Animating and Intercepting Events Image Based Animation

Rob Chapman
PLUS
Rob Chapman
Courses Plus Student 3,755 Points

Followed the tutorial but then the application failed to run after adding animation

Followed the steps in the video but I got four errors which did not appear in the tutorial.

When I added the line self.backgroundImageView.animationImages = [[NSArray alloc] initWithObjects: the error said Property 'animationImages' not found on object of view type 'UIView*'

Then the lines self.backgroundImageView.animationDuration = 2.5f; and self.backgroundImageView.animationRepeatCount = 1; were both met with the errors Property 'animationDuration' not found on object of type 'UIView*' and Property 'animationRepeatCount' not found on object of type 'UIView*' respectivly.

Finally [self.backgroundImageView startAnimating]; said No visible @interface for'UIView' declares the sector 'startAnimating'.

Any help would be appreciated, thanks.

2 Answers

Pierre Thalamy
Pierre Thalamy
4,494 Points

I will need some additional details, could you upload your project folder to Dropbox and send me the link, so I can have a look at it?

EDIT: Check that your IBOutlet is linked to a UIImageView object on the Main.storyboard, and not any other kind of object. Perhaps try relinking it as well. You can find a little more info about SIGABRT in this SO thread, yet it this is not a very specific error, so you cannot easily know what is causing it.

Rob Chapman
Rob Chapman
Courses Plus Student 3,755 Points

Thanks this has fixed the problem. I deleted the code for the IBOutlet and then relinked it and now it works fine.

Pierre Thalamy
Pierre Thalamy
4,494 Points

backgroundImageView is a UIImageView object, not a UIView.

You probably incorrectly declared the property in the viewController header file, check that this line appears in it:

@property (weak, nonatomic) IBOutlet UIImageView *backgroundImageView;
Rob Chapman
Rob Chapman
Courses Plus Student 3,755 Points

I have just checked this and realised I had written UIImage and not UIIMageView. I have changed this but now when I run the application it is just a black screen. It takes me to a screen under thread 1 and the line,

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

is highlighted and on the far right it says Thread 1: signal SIGABRT. I have never seen this screen before and i dont know what it means.