invalid redeclaration of 'pickerData'

Discussion in 'iOS Programming' started by ethan-1878, Sep 21, 2015.

  1. ethan-1878 macrumors member

    Jun 8, 2014

    I'm a complete Swift noob and this is the first time I've ever written an iOS app. I'm trying to use two UIPickerView elements in one ViewController. I have had one working fine but can't figure out how to introduce the second.

    If anyone could help that would be great. Also, if you want any snippets of my code, just ask and I'll be happy to post it here!

  2. steelzeh macrumors newbie


    Jun 3, 2014
    Please post some of your code so that we can se what your are doing wrong. It's hard to diagnose the problem without the code :)
  3. Punkjumper macrumors member

    Jan 12, 2013
    You can't name something pickerdata twice. You need a second data object for the second picker
  4. ethan-1878 thread starter macrumors member

    Jun 8, 2014
    Hi @Punkjumper and @steelzeh

    I managed to fix my problem by merging both aspects into one! I still need some help with the progression my project though so let me know if you're willing to help and i'll post some more details - I don't want to bog up a thread with one massive post.


  5. Punkjumper macrumors member

    Jan 12, 2013
    If you need/ want help, post code and the trouble your having
  6. giri1988 macrumors newbie

    Apr 11, 2017
    You have to use two instances of uipickerview.
    for eg,
    let picker1 = UIPickerView()
    let picker2 = UIPicerView()

Share This Page