Access array variable

Asked

Viewed 43 times

1

I have the following problem, has an array that is my Picker, and I have a function that knows the position of my Picker, so I would like to compare to know which text is at that position , that is to know the text that is at the array position :

var pickerDataSource = ["OPC A", "OPC B", "OPC C", "OPC D"];
func x () {labelDaPosicao = self.pickerDataSource[row] }

Recalling that the row is given by the function, how can I solve this?

  • http://sourcefreeze.com/ios-uipickerview-example-using-swift/

  • friend had already seen this tutorial, however this is not what I need, the question is how to access Aray, as : array[0] or array[variavel_rows] thanks

  • I solved the problem by some Xcode bug after restarting worked... Thanks

  • @Augustofurlan if you know what the bug was you can add a complete answer, with solution and explanation to be useful to others who may have the same problem. That would be ideal :)

  • Augusto, this site works like Wikipedia. You’ve seen someone put "Hi guys, let’s talk about Such Subject" there? For it is, here is same thing, greetings are considered noise, please focus on the problem. Can socialize at will in [chat].

  • @brasofilo until the "I have the following problem" is noise, after all if it was not, would not be asking :)

  • Okay, sorry, just trying to be polite ....

  • No problem at all, Augusto. It’s only because I saw that they had already removed this in previous questions of yours, so I thought it best to give the touch and thus save the work of the editors. When someone edits your post, it’s nice to check the history to see what improvements they make. Thanks!

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.