开发者

selectedRowInComponent not working

开发者 https://www.devze.com 2023-04-09 02:51 出处:网络
I have the following issue (with iPhone SDK) : The selectedRowInComponent method of UIPickerView returns the correct value the first time it is 开发者_StackOverflow中文版called and then keeps returnin

I have the following issue (with iPhone SDK) : The selectedRowInComponent method of UIPickerView returns the correct value the first time it is 开发者_StackOverflow中文版called and then keeps returning the same value eventhough the PickerView object has been moved.

The first time answer is correct even if I make a first move before calling the method.

Any idea for the possible cause of the problem ?

Thanks.


One possible cause for this issue is not making a connection in interface builder to the picker. Ensure you have an IBOutlet for your picker then drag from File's Owner to the picker in the xib file. Select the picker in the menu that pops up. Thats the obvious solution, however without viewing the code its hard to tell for sure what is going on. Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号