swift - How to display the values of each array in larger array? -


i have

    var array = [["chinese"],["italian"],["thai"]] 

and i'm looking set names of these 3 array values label in table list.

i can't set

cell.namelabel.text = array.string  

or that.

would able recommend solution?

- quick , dirty way done here.....

var array = [["chinese"],["italian"],["thai"]] cell.namelabel.text = array.string  = array[0][0] 

- 1 can iterate using for-in on array of arrays (ie. array) here , access them thats 1 way it.

- 1 can try fetch values in array single dimension array, access gets easier if thats motive of code.

var array = [["chinese"],["italian"],["thai"]]   var valarray: [string] = []   value in array  {      innervalue in value      {         valarray.append(innervalue)      }  }   print(valarray) 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -