16

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

Matt Winters
  • 1,099
  • 2
  • 12
  • 22

3 Answers3

38

I think you should be using:

reloadComponent:

or

reloadAllComponents:

Avalanchis
  • 4,500
  • 3
  • 39
  • 48
4

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.

MarkPowell
  • 16,482
  • 7
  • 61
  • 77
1

I think you should be using: reloadComponent or reloadAllComponents.

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

atxe
  • 5,029
  • 2
  • 36
  • 50
  • Welcome to Stack Overflow. This question has already been answered with the same information you have written here. If you want to add something to their answers, you can put it in a comment under it. :) – Emil Mar 16 '12 at 12:42