UIPickerView not displaying
Posted
by 4thSpace
on Stack Overflow
See other posts from Stack Overflow
or by 4thSpace
Published on 2010-05-02T18:56:32Z
Indexed on
2010/05/02
19:17 UTC
Read the original article
Hit count: 385
I have a UIPickerView on a UIView. I've implemented its protocol and delegates in the .m file:
<UIPickerViewDataSource, UIPickerViewDelegate>
In IB, I've connected the above to the picker, which I also have an IBoutlet for. The methods look like this:
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {
return [self.arr count];
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return @"test";
}
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
//do something
}
Any ideas which piece I'm missing to get the picker working?
© Stack Overflow or respective owner