I need the last selected row in my pickerview to be totally recalled when the view appears! I have this code in my viewDidAppear
it animates to the last selected row but it doesn't really call the delegate
and the NSLog
in my rows won't print without touching my picker and reselect them.
How do I do that?
- (void)viewDidAppear:(BOOL)animated {
NSUserDefaults *pickerViewSelectionDefaults = [NSUserDefaults standardUserDefaults];
[tasbeehPicker selectRow:[pickerViewSelectionDefaults integerForKey:@"picker"]
inComponent:0 animated:YES];
[pickerViewSelectionDefaults synchronize];
[UIPicker reloadAllComponents];
NSLog(@"Last selcted row was %d ",[[NSUserDefaults standardUserDefaults] integerForKey:@"picker"]);
}