Reputation: 638
I have a ViewController
for my app which has a single button which, when clicked, I need to show a popup view to allow the user to select from a list of addresses.
I've implemented the ViewController
as follows:
@interface WelcomeViewController : UIViewController<UIPickerViewDelegate, UIPickerViewDataSource, UIPopoverControllerDelegate>
And I've implemented the necessary delegate functions for the picker. I see the popup appear and display the UIPickerView
inside it with the addresses correctly populated. The popup also disappears when I pick outside its frame - so that part appears to be working right.
However the picker just does not respond to picks (it does nothing!) - and in the debugger I see that didSelectRow is not getting called.
I have tried everything I can think of! Any help and advice would be appreciated!
9/24 UPDATE: I got this working but had to sacrifice using the Popover ViewController so it is not an ideal solution. I did it as follows:
This works now, the downside of this implementation is that the address picker does not disappear when I pick outside the pickerview's frame (I imagine this is because it is not inside a popoverviewcontroller) I worked around this by setting the hide property on the pickerview when the user performs the next action. I have read about a better workaround in Stackoverflow where the entire background was a part of one big button - and I may resort to that if I cant find a way to get the picker inside a popup)
Upvotes: 0
Views: 986
Reputation: 5570
If you have not already you also set the picker delegate property to be your instance of WelcomeViewController
Upvotes: 1