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 respond to '-reloadData'
Although this appears to work, is there something else that I should use to reload data?
Thanks
A view that uses a spinning-wheel or slot-machine metaphor to show one or more sets of values.
UIPickerView is a subclass of UIView . It is useful for iOS apps that use a spinning wheel with many choices for the user. @MainActor class UIPickerView: UIView. One example of this type of app is a slot machine, where a user spins the wheels to play the game.
UIPickerView can have multiple wheels (named components), and are numbered starting at 0. For example, a picker view with 3 components looks like the following where. the first wheel ("6") is component 0. the second wheel ("00") is the component 1. the third wheel ("AM") is the component 2.
A picker view can be defined as the view that shows a spinning wheel or slot machine to display one or more set of values so that the user can spin the wheel to select one. It is an instance of UIPickerView class which inherits UIView.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With