you are setting a value for a NULL
Key
Edit:
befor you start using the picker you need to:
in the .h file:
UIViewController<UIPickerViewDelegate,UIPickerViewDataSource>{
NSArray *array;
}
then in the .m file:
-(void)viewDidload{
[super viewDidload];
array = [[NSArray alloc]initWithObjects:@"Lake",@"Diana",@"Jone",@"Alice",@"Byber",@"Nuces",nil];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {
return [array count];
}
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
/* do what you want if the picker selected */
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [array objectAtIndex:row];
}