Select row After UIPickerView is loaded

后端 未结 6 2001
广开言路
广开言路 2020-12-07 22:13

I have an iPhone database app that loads a UIPickerView with data from a table. I want to set the selected row to a particular row from the data in another tab

6条回答
  •  星月不相逢
    2020-12-07 22:18

    I have just found that on the 4.3 SDK's the component loading behaviors are different between the iPhone and the iPad. On the iPhone, I was about to invoke selectRow: right after initializing the view before or after adding to the subview hierarchy. On iPad however, the selectRow call yielded no results. I wound up using a performSelector:withObject:afterDelay: call to wait 0.1 seconds before firing selectRow:inComponent:animated:. This had predictable results on the iPhone and iPad.

提交回复
热议问题