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

How would I make my "Crystal ball app" display "predictions in the order I place them in the array?

Just for the fun of it I want my crystal ball app to NOT be random. Instead I would like the predictions to be in the order I put them in the array. How would I do this?

2 Answers

thats a good question. the only thing i can think of is removing the the arc4random method but i don't know a method you can call that will return them in ascending or any specific order.

I answered this question back here

Where do you put those lines? in the viewcontroller.h/m or in crystalball.h/m? and I assume I wont need the "randomPrediction" method anymore?

This keeps giving me an error. Its saying "predictionLabel" is not found on object of type "RRGCrystalBall" any ideas as to why?

-(NSString*) makePrediction{ self.predictionLabel.text = self.predictions[self.currentIndex % self.predictions.count]; self.currentIndex += 1; }