I am creating a calculator for some cards game. In that game, I am creating a Singleton class to manager the game. It holds the scores, keeps track of where the game is etc...
Now after the app launches, I will ask the user to enter 4 players' names. After that, 4 player objects are instantiated according to their names. I already have an object called "Player", so 4 players will get instantiated with their name, and a score of 0 to start with.
Now I need to store those players in my singleton class. Therefore, I created 4 Player properties in the class. However my question is, under the init
method in the Singleton class, in:
if ((self = [super init])) {
// set properties here
}
Where // set properties here
is, what do I write? Do I have to do anything with the Players properties over there?
Thank you,