views:

241

answers:

1

Hi all,

I have added both a UIPickerView and a UIDatePickerView to a single view. I set the pickerview delegate to self.view and it works fine.

However, if I select the UIDatePicker first, I cannot get the value of 'selectedRowInComponent`. If I select the UIPickerView first I can.

Does UIDatePickerView respond to selectedRowInComponent?

A: 

UIDatePicker does not respond to selectedRowInComponent. It's not a subclass of UIPickerview. You can only ask for its date info.

TechZen
i am surely know that but when i change the month on datapicker then i can get other pickerview selectedRowInComponent,i think maby this is a bug of uidatapicker and uipickerviewif you see the source of datapicker you will see :private uipickerView!
phpxiaoxin
If you have the same object set as the delegate for both pickers then they might both be sending 'selectedRowInComponent' even though the DATE (note DATA) picker is not supposed to. If this is the problem you need to check for the class of the picker in 'selectedRowInComponent' before you send any calls to the picker.
TechZen