iphone - UIPickerView selectRow:inComponent:animated not working in viewDidLoad but working in viewDidAppear -
this issue driving me crazy. have uipickerview loaded in viewdidload, , need initialize selected row appear on screen. code 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 in viewdidload. nslog logs value of 2. however, selected row pops first row , not second.
if put selectrow in viewwillappear, doesn't work.
if put selectrow in viewdidappear, pickerview appears , goes second row.
update: if have more 2 rows, method works correctly viewdidload, unless scrolling last row. method never works in viewdidload or viewwillappear if scrolling last row. idea why is? thanks.
how selected row second row before view appears?
thanks.
Comments
Post a Comment