So I implemented a PickerView and everything works fine when I pick some value, but if I don’t pick anything the
- (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated
is not called. And I want if user doesn’t pick a value, the first value is picked.
So I implemented:
-(void)viewDidAppear:(BOOL)animated
{
[pickerView selectRow:0 inComponent:0 animated:YES];
}
but it doesn’t work. Why isn’t selectRow:inComponent: method called after this?
Make a new function to be called when you start. If you want the code input to be read when you start the app, you need to put it under the viewDidLoad
If this doesn’t help, take a look at my project which uses some of the same mechanics.
http://pastebin.com/WLGq3jvv