UIPickerView selectRow:inComponent:animated not working in viewDidLoad but working in viewDidAppear
问题 This issue is driving me crazy. I have a UIPickerView that I loaded in viewDidLoad, and I need to initialize the selected row that is to appear on the screen. My code is as follows: self.pickerSkins.delegate = self; [self.pickerSkins reloadAllComponents]; NSLog(@"%d", [self.pickerSkins numberOfRowsInComponent:0]); [self.pickerSkins selectRow:1 inComponent:0 animated:NO]; I have put this in viewDidLoad. NSLog logs a value of 2. However, the selected row that pops up is always the first row and