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
Alex Albert
1,464 PointsAnimation of Crystal Ball in 'Build a Simple IOS app' not working
I start off with the regular background image, but as soon as the animation starts, the images zoom-in to the point where I can't see the edges of the crystal ball. What is happening?
Here is my code for the animation:
self.crystalBall = [[AACrystalBall alloc] init]; self.backgroundImageView.animationImages = [[NSArray alloc ] initWithObjects: [UIImage imageNamed:@"CB00001"], [UIImage imageNamed:@"CB00002"], [UIImage imageNamed:@"CB00003"], [UIImage imageNamed:@"CB00004"], [UIImage imageNamed:@"CB00005"], [UIImage imageNamed:@"CB00006"], [UIImage imageNamed:@"CB00007"], [UIImage imageNamed:@"CB00008"], [UIImage imageNamed:@"CB00009"], [UIImage imageNamed:@"CB00010"], [UIImage imageNamed:@"CB00011"], [UIImage imageNamed:@"CB00012"], [UIImage imageNamed:@"CB00013"], [UIImage imageNamed:@"CB00014"], [UIImage imageNamed:@"CB00015"], [UIImage imageNamed:@"CB00016"], [UIImage imageNamed:@"CB00017"], [UIImage imageNamed:@"CB00018"], [UIImage imageNamed:@"CB00019"], [UIImage imageNamed:@"CB00020"], [UIImage imageNamed:@"CB00021"], [UIImage imageNamed:@"CB00022"], [UIImage imageNamed:@"CB00023"], [UIImage imageNamed:@"CB00024"], [UIImage imageNamed:@"CB00025"], [UIImage imageNamed:@"CB00026"], [UIImage imageNamed:@"CB00027"], [UIImage imageNamed:@"CB00028"], [UIImage imageNamed:@"CB00029"], [UIImage imageNamed:@"CB00030"], [UIImage imageNamed:@"CB00031"], [UIImage imageNamed:@"CB00032"], [UIImage imageNamed:@"CB00033"], [UIImage imageNamed:@"CB00034"], [UIImage imageNamed:@"CB00035"], [UIImage imageNamed:@"CB00036"], [UIImage imageNamed:@"CB00037"], [UIImage imageNamed:@"CB00038"], [UIImage imageNamed:@"CB00040"], [UIImage imageNamed:@"CB00041"], [UIImage imageNamed:@"CB00042"], [UIImage imageNamed:@"CB00043"], [UIImage imageNamed:@"CB00044"], [UIImage imageNamed:@"CB00045"], [UIImage imageNamed:@"CB00046"], [UIImage imageNamed:@"CB00047"], [UIImage imageNamed:@"CB00048"], [UIImage imageNamed:@"CB00049"], [UIImage imageNamed:@"CB00050"], [UIImage imageNamed:@"CB00051"], [UIImage imageNamed:@"CB00052"], [UIImage imageNamed:@"CB00053"], [UIImage imageNamed:@"CB00054"], [UIImage imageNamed:@"CB00055"], [UIImage imageNamed:@"CB00056"], [UIImage imageNamed:@"CB00057"], [UIImage imageNamed:@"CB00058"], [UIImage imageNamed:@"CB00059"], [UIImage imageNamed:@"CB00060"],nil]; self.backgroundImageView.animationDuration = 2.5f; self.backgroundImageView.animationRepeatCount = 1;
3 Answers
Stone Preston
42,016 Pointscan you upload your project to dropbox? ill take a look at it. nothing really looks wrong with the code you posted
Stone Preston
42,016 Pointsok fixed your problem I think. Something was going on with your animation images and the @2x sizes.
first remove all background images and and animation images from your project asset catalog. . download the background images here and the animation images here and drag them into your project asset catalog. make sure you drag both the normal and @2x images into the catalog. make sure the imageView in your viewcontroller is set to the correct image.
after that build and run and the animation looks ok. however it looks like there may be a problem with the animation images. the crystal ball in the animation images is a bit smaller than the one in the background image so it doesnt look very good when its starts and finishes. Amit Bijlani have you seen this before? here are the images side by side
cameryn smith
2,828 PointsHey Stone Preston can you take a look at my code. I finished the crystal ball app and I'm running into debugging problems.The app keeps crashing and I think it has something to do with the storyboard. I even checked my view's identifier but everything was good. If I upload it to dropbox or something can you take a look at it.
Stone Preston
42,016 PointsStone Preston
42,016 Pointssorry forgot to say ill need the entire project folder. so if you have your project called CrystalBall saved in a folder named projects, you would need to upload the directory /projects/CrystalBall/. it wont work if you just upload the .xcodeproj file
Stone Preston
42,016 PointsStone Preston
42,016 Pointsthats still not the correct folder. go up one more directory. the folder I need is going to be called Crystal Ball. Inside that folder is another folder called Crystal Ball which is the one you linked above. so you need to go up one more directory from the one you linked above and then upload that folder
Stone Preston
42,016 PointsStone Preston
42,016 PointsI think thats the same one you linked earlier. still not the right one
Alex Albert
1,464 PointsAlex Albert
1,464 PointsIs this it?: https://www.dropbox.com/sh/32phxac1s8tyjb8/AAAmElOrcE0970SlEJlzlB6Wa?dl=0
Stone Preston
42,016 PointsStone Preston
42,016 Pointsyep thats it