iOS invalid redeclaration of 'pickerData'

ethan-1878

macrumors member
Original poster
Jun 8, 2014
45
1
Hi,

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!


Thanks!
 

steelzeh

macrumors newbie
Jun 3, 2014
9
0
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 :)
 

Punkjumper

macrumors member
Jan 12, 2013
48
3
You can't name something pickerdata twice. You need a second data object for the second picker
 

ethan-1878

macrumors member
Original poster
Jun 8, 2014
45
1
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.

Thanks,

Ethan.
 

Punkjumper

macrumors member
Jan 12, 2013
48
3
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.

Thanks,

Ethan.
If you need/ want help, post code and the trouble your having
 

giri1988

macrumors newbie
Apr 11, 2017
2
0
You have to use two instances of uipickerview.
for eg,
let picker1 = UIPickerView()
let picker2 = UIPicerView()
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.