Tutorial on how to create a Picker View (UIPickerView) in xCode 4.3.2

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025

ความคิดเห็น • 65

  • @dmagnin
    @dmagnin 12 ปีที่แล้ว

    thanks a billion. I have been messing with this concept through 15 tutorials, that don't really work.
    I needed this knowledge and appreciate it !!!!!
    Dale Magnin

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Glad to hear it helped. Since the picker is really just a mechanism to select things, you could really combine it with most other items.

  • @MissRann
    @MissRann 12 ปีที่แล้ว

    Thank you very much for posting this video vtkurup! I learned a few other helpful tips, other than implementing a UIPickerView. Very helpful!

  • @yousj
    @yousj 11 ปีที่แล้ว

    Thank you Vishal. I like your style and level of detail in your tutorial. This was very helpful for me.

  • @glennpotter4079
    @glennpotter4079 12 ปีที่แล้ว

    Great Lesson! You have a gift for teaching Xcode!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    You are 100% correct but this was meant to be just an illustration on how to use picker views :) One way to do what you are describing would be to have a UIButton in your first view controller that modally loads another view controller with a picker view in it. Then set your values using the picker view and dismiss that view controller.

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Thanks for the kind words. Glad the tutorial helped!

  • @VishalKurup
    @VishalKurup  11 ปีที่แล้ว

    You are most welcome Scott! Thanks for the kind words.

  • @carlosmatos9590
    @carlosmatos9590 12 ปีที่แล้ว

    Congratulations!
    great lesson!

  • @LaythT
    @LaythT 12 ปีที่แล้ว

    Brilliant tutorial. Thanks so much!

  • @jakisurwis
    @jakisurwis 12 ปีที่แล้ว

    just what I needed. thank you!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    No problem Dale. Glad it helped!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    You are most welcome! Glad it helped!

  • @321ali
    @321ali 12 ปีที่แล้ว

    Are you able to make other videos on what else can be done with Pickerview?
    I was wanting each PickerView to take me to a new view controller. How can this be done?
    BTW- awesome tutorial... everything worked the first go

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Thanks for the kind words!

  • @xmaurogarridox
    @xmaurogarridox 12 ปีที่แล้ว

    muchas gracias amigo, me has ayudado demasiado. Busqué mucho como poder hacer esto. Gracias
    Blessings...!!!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Ah. You can still do that manually. Go to your class and header file and create an IBOutlet (property) for that UIImageView and any other objects needed. Also synthesize it in the implementation file. Then jump back to Interface Builder and right click each item and drag a connection from the menu item to file's owner. If you have defined your outlets correctly, the appropriate options will show up in a menu. (I believe this latter functionality is available in that version of xCode).

  • @traustisigurjonsson7286
    @traustisigurjonsson7286 12 ปีที่แล้ว

    Great video, well explained and just super :)
    I was thinking if i want to put second view picker in same view do i need to do everything again as with the first picker or is there any shortcut, thanks

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Glad I could help!

  • @AkashBhardwaj97
    @AkashBhardwaj97 11 ปีที่แล้ว

    Thanks for the video!! Even works with Xcode 5

    • @VishalKurup
      @VishalKurup  11 ปีที่แล้ว +1

      Glad I could help Akash! I need to update some of these for iOS 7 :)

    • @AkashBhardwaj97
      @AkashBhardwaj97 11 ปีที่แล้ว

      Will you do tutorials on NSDictionary? That is what I am having trouble with. Thanks in advance!!

  • @LewisSmith42
    @LewisSmith42 13 ปีที่แล้ว

    Great tutorial, thanks! :)

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Gracias Carlos!

  • @sean1magin
    @sean1magin 12 ปีที่แล้ว

    Really helpful and indeapth tutorial. One question is that my software version does not have the File Owner icon on the interface. My version is 4.5.2. At 8:00 in the tutorial, where should I drag the connector lines?

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    De nada Mauricio!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Glad to help!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Thanks Layth!

  • @horhorpig
    @horhorpig 10 ปีที่แล้ว

    very useful, thanks a lot!

  • @TubberXMAN
    @TubberXMAN 12 ปีที่แล้ว

    First great video. Thanks for it.. Do you know if it is posible to change the Hight of the Picker view?

  • @M7moodW
    @M7moodW 11 ปีที่แล้ว

    thank you very much, its help me a lot, and your explanation was very clear, i try to make it using UITextField and its working fine, but i have question if you can help me. how if i want to make the picker view hidden and i want to enable it when i click on the textField

  • @DunkinDonutKaset
    @DunkinDonutKaset 12 ปีที่แล้ว

    Good Tutor thank you.

  • @__G10
    @__G10 12 ปีที่แล้ว

    Very helpful! thanks

  • @Beattraceur
    @Beattraceur 12 ปีที่แล้ว

    Thanks for the fast reply.
    But how could I do the magic trick on 05:22, without the Assistant Editor?

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Thank you sir! :)

  • @KiwisVids
    @KiwisVids 11 ปีที่แล้ว

    Cheers pal!

  • @po6402
    @po6402 12 ปีที่แล้ว

    Thanks a lot! If I want to create 3 of components and images
    how to do that?

  • @squashmasterchild
    @squashmasterchild 11 ปีที่แล้ว

    Hey i am following the video correctly, what xcide version are you on at the time, im on 4.6

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Howdy! Did you get this bug resolved? I have been a little swamped and havent had a chance to take a look at this yet, but can do so if needed.

  • @xtremelfe07
    @xtremelfe07 12 ปีที่แล้ว

    Great tutorial! I have run into a slight hiccup though. It works great in my simulator but crashes on my device. I am having memory warnings with this code, that ends up crashing my app. I believe I need to retain the images within this pickercontroller. Do you know how to do that, or what the solution might be?

  • @VishalKurup
    @VishalKurup  11 ปีที่แล้ว

    Jackson - In this video I was using version 4.3.2 - It's in the title.

  • @TheHurleybiy
    @TheHurleybiy 12 ปีที่แล้ว

    A couple is two!!
    Great video though.

  • @321ali
    @321ali 12 ปีที่แล้ว

    Can we make the selection in Pickerview take us to a new page rather than displaying the selection at the top or bottom of the page?

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Its possible that its just hidden. Try toggling one of the views in the upper right corner of the window.

  • @Beattraceur
    @Beattraceur 12 ปีที่แล้ว

    Thanks again.
    But after all my "@synthesize" lines he shows me an error.
    By @synthesize characterImage; he shows me:
    "error: synthesized property 'characterImage' must either be named the same as a compatible ivar or must explicitly name an ivar"
    What does that mean?... has it something to do with the trick on 05:22?
    And what about "strong" in the @property(strong,nonatomic), which isn't colored right now?

  • @xtremelfe07
    @xtremelfe07 12 ปีที่แล้ว

    Yes! The problem was I had my png files all over 2MB (I come from a production background and love HQ) So I recreated each png to an 1/8th of original size and that got rid of the crashes.

  • @0805bryan
    @0805bryan 12 ปีที่แล้ว

    great !!

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    No problem Vignesh. Hope it helped.

  • @franconorris4791
    @franconorris4791 12 ปีที่แล้ว

    im trying to populate my *urL with the contents of the picker view i.e: if pickerview is showing "vid 1" then pressing the UIRecbutton labelled "play vid" would play vid 1, ect.. any help greatly appreciated, i have all code set up apart from how to get picker view info to vid player :
    if the row in pickerview reads Video1, video2 ect.. how to i get this info to the pathforresource & have it default to movie type, i.e.: mov, mpeg4 .
    tx franco

  • @oglennyface
    @oglennyface 12 ปีที่แล้ว

    Hmm... I followed your tutorial, but when I try to run it on the simulator, I get a black screen. No errors when building. Any Ideas? (I used Numbers instead of text for the picker, if it matters. Still in "".)

  • @NavyGunner1980
    @NavyGunner1980 11 ปีที่แล้ว

    How can you load the second component base on the first

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Hey Benny - I dont think it should be very much different. If that's what you are running, just try it - I dont think the methods (functions) have changed that much

  • @robotmamo
    @robotmamo 12 ปีที่แล้ว

    I dont have that sidebar where File's owner is at 8:10. Please help!

  • @alex73ri
    @alex73ri 12 ปีที่แล้ว

    Thanks!

  • @mathieusan
    @mathieusan 12 ปีที่แล้ว

    usually you want a picker view on user's request. Say the user click on a data entry (button) and the picker view appears, user make choice, and pickerview go away.. This tutorial is "half way" as you never want "just a pickerview" app... but great info nonetheless.

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Sean, sorry its taken me a while to respond. I didn't think that was even possible if you had an XIB/NIB file:) Did you get this resolved?

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Sorry its taken a while to respond. Its not possible to change the height in Interface Builder, but you may be able to do it programmatically. Take a look at this thread on Stack Overflow: stackoverflow(dot)com/questions/573979/how-to-change-uipickerview-height

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Sorry its taken me a while to respond. Did you resolve this bug?

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    Hmm. That's odd. When you say you used numbers in double quotes - You mean you still created NSStrings correct? Maybe post or message me with at least your viewDidLoad method and your pickerView: titleForRow: forComponent methods contents.

  • @Beattraceur
    @Beattraceur 12 ปีที่แล้ว

    how is it possible to make this on xcode 3.2.1?

  • @squashmasterchild
    @squashmasterchild 11 ปีที่แล้ว

    you do not enable storyboard

  • @Memtimen
    @Memtimen 11 ปีที่แล้ว

    thanks

  • @RobertYounan1
    @RobertYounan1 11 ปีที่แล้ว

    me like=)

  • @TDKdc60
    @TDKdc60 11 ปีที่แล้ว

    I believe he is using a project with a storyboard.

  • @VishalKurup
    @VishalKurup  12 ปีที่แล้ว

    You purists!!! hehehe.