ios - Error assigning a string array in Swift -


i programmatically presenting view controller , changing value of string array string array value stored in sql (gamegametabledata). stuck on error "cannot assign value of type 'string' value of type [string]". not sure why happening. when println(gamegametabledata[index]), string array, swift telling me not string array. appreciated.

var gamegametabledata: [string] = []   override func viewdidload() {     super.viewdidload()              let index = indexpath.row              //error below!!! "cannot assign value of type 'string' value of type [string]"             gameviewcontroller.tabledata = gamegametabledata[index]          } 

println(gamegametabledata)[index] returns:

[cricket3.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png, cricket1.png]

your array declaration seems wrong. below.

var gamegametabledata: [[string]] = []  override func viewdidload() {     super.viewdidload()     let index = indexpath.row      //error below!!! "cannot assign value of type 'string' value of type [string]"     gameviewcontroller.tabledata = gamegametabledata[index]          } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -