June 2014
Beginner to intermediate
434 pages
9h 49m
English
What's the purpose of the highscores table if you can't beat any of the highscores? Let's change that and replace the test data with the actual highscores. To do this, we're going to need the player to enter their name when they beat a highscore:
Common group. Name the class HighscoreManager and make it a subclass of NSObject.HighscoreManager.h file and replace its contents with the following code:#import "GameStats.h" #define kMaxHighscores 5 @interface HighscoreManager: NSObject -(NSArray *)getHighScores; -(BOOL)isHighscore:(int)score; -(void)addHighScore:(GameStats *)newHighscore; +(HighscoreManager *)sharedHighscoreManager; @end
HighscoreManager.h ...