I have a question about core data. My entity look like this:
- Game (GameID, GameName, Players, timestamp)
- User (UserID, Email, status...)
- Message (GameID, MessageText, SendersID)
In the table Game I want to store all players who are in this game. The problem is that they can be 2 or more so I have to store an array... I thought about two solutions..
My first solution would be storing a string into members which would look like this:
3,4,5,6,11
And then split it into an array
let members = fetchedData.Players.characters.split{$0 == ","}.map(String.init)
The second one: (I think this is the "cleaner" version)
I'll make my entity look like this:
Game (GameID, GameName, timestamp)
and add another entity:
Players (GameID, UserID)
What do you think? What advantages do I have if I make another Entity? (I think I'll have better performance but I also think that I'll have to much data)