开发者

UIPickerView reloadData

开发者 https://www.devze.com 2023-01-06 16:47 出处:网络
I\'m changing components (in particular, the number and color of components), in a UIPickerView that I call pickerOne, so after making the changes, I call:

I'm changing components (in particular, the number and color of components), in a UIPickerView that I call pickerOne, so after making the changes, I call:

[pickerOne reloadData];

and it appears to be working perfectly however, I'm getting a compile warning:

warning: 'UIPickerView' may not re开发者_开发问答spond to '-reloadData'

Although this appears to work, is there something else that I should use to reload data?

Thanks


I think you should be using:

reloadComponent:

or

reloadAllComponents:


You should be calling reloadComponent: or reloadAllComponents:.

There may be a private reloadData used under the covers, but it's not part of the public API, and therefore, shouldn't be relied upon.


I think you should be using: reloadComponent or reloadAllComponents.

But these methods are useless unless you connect UIPickerViewDalegate and UIPickerViewDataSource to file owner.

0

精彩评论

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