UIPickerView重新加载数据
我正在更改组件(特别是组件的数量和颜色),在我称为 pickerOne 的 UIPickerView 中,因此在进行更改后,我调用:
[pickerOne reloadData];
并且它似乎工作正常,但是我收到了编译警告:
warning: 'UIPickerView' may not respond to '-reloadData'
虽然这似乎有效,但我还应该使用其他东西来重新加载数据吗?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你应该使用:
reloadComponent:
或
reloadAllComponents:
I think you should be using:
reloadComponent:
or
reloadAllComponents:
您应该调用
reloadComponent:
或reloadAllComponents:
。可能在幕后使用了私有
reloadData
,但它不是公共 API 的一部分,因此不应依赖它。You should be calling
reloadComponent:
orreloadAllComponents:
.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.我认为您应该使用:
reloadComponent
或reloadAllComponents
。但除非将
UIPickerViewDalegate
和UIPickerViewDataSource
连接到文件所有者,否则这些方法毫无用处。I think you should be using:
reloadComponent
orreloadAllComponents
.But these methods are useless unless you connect
UIPickerViewDalegate
andUIPickerViewDataSource
to file owner.