I am trying to update a string array with data from SQLite. The data I am trying to use is called gameGAMETABLEDATA, which is a string array. I am able to save a string array as gameGAMETABLEDATA in SQLite with an action, and when I println(gameGAMETABLEDATA), it returns:
[cricket3.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png].
So the value inside it is a string array. However, Xcode does not identify this value in SQLite as a string array, but rather as a string. I know so because when I try to change GameViewController.tableData to match gameGAMETABLEDATA[index] there is an error.
SavedGames.swift
var gameGAMETABLEDATA: [String] = []
//Error below!!! "Cannot assign a value of type 'String' to value of type [String]"
GameViewController.tableData = gameGAMETABLEDATA[index]
}
GameViewController.swift
var tableData: [String] = ["cricket1.png", "cricket1.png", "cricket1.png", "cricket1.png", "cricket1.png", "cricket1.png", "cricket1.png"]
What is going on? When I do GameViewController.tableData = [gameGAMETABLEDATA[index]] it doesn't work. Any help would be nice. Thank you.