Has anyone had any luck using a UIPicker in the 3.2 SDK? I'm in the middle of porting an iPhone application over to an iPad and that's the one thing I can't seem to get to work. I've tried...
-Creating an action sheet, add the picker as a subview and displaying it.
-Creating that above action sheet, making it the view of a generic ViewController, adding that VC to a UIPopover
-Making just the picker the view of a generic ViewController, adding that VC to a UIPopover
With the action sheet it doesn't even attempt to draw it. In the popover view it attempts to draw but doesn't get rendered correctly.
Just wanted to check to see if anyone has accomplished this and if so how.
Thanks everyone!
I just struggled with this for about 24 hours and got it to work by following this tutorial and wherever he mentions his UITableView, just think about your UIPickerView and replace the appropriate info.
Matthew Casey - Tutorial: Introduction to Pop Over Control on iPad
In short, on the iPad, the ONLY way you can show a picker is inside a popover control. Sharing data between the popover's content view controller (the picker view's view controller) and the main app's view controller is the bit I couldn't figure out. (i.e. getting the picker's "didSelectRow" method to affect an object in your main view controller, say a UITextField or UIButton.) This is handled by creating a custom protocol to forward the "didSelectRow" method to the main view controller.
I'm by no means an expert at this stuff, so I went step by step with that tutorial and it DID work in the end. Before I found that tutorial I was lost. (I am also porting over an iPhone app to iPad.)