objective c - ios UIPickerView scrolling too fast -


i using uipickerview in conjunction uitextfield input values textfield. pickerview displays range of numbers each number equivalent row in picker view.

- (nsinteger)numberofcomponentsinpickerview:(uipickerview *)pickerview {     return 1; }  - (nsinteger)pickerview:(uipickerview *)pickerview numberofrowsincomponent: nsinteger)component {     return self.max + 1; }  - (nsstring *)pickerview:(uipickerview *)pickerview titleforrow:(nsinteger)row forcomponent:(nsinteger)component {     return [nsstring stringwithformat:@"%d", row]; } 

when user selects value in picker text field should reflect value:

- (void)pickerview:(uipickerview *)pickerview didselectrow:(nsinteger)row incomponent:      (nsinteger)component {     self.quantityfield.text = [nsstring stringwithformat:@"%d", row]; } 

however, noticing if spin picker quickly, row passed didselectrow not match row settled upon in picker. thoughts on why happening , how prevent this?

the field 6 in represents uitextfield. can see picker settled on 10.

my complete set follows:

i have uitableview number of custom uitableviewcells. each cell has uitextfield referred self.quantityfield.

i set following up:

// pickerview represents uipickerview. self.quantityfield.inputview = self.pickerview; uitoolbar *mytoolbar = [[uitoolbar alloc] initwithframe:cgrectmake(0,_pickerview.frame.origin.y - 44, self.frame.size.width, 44)];  uibarbuttonitem *donebutton = [[uibarbuttonitem alloc] initwithtitle:@"done" style:uibarbuttonitemstyleplain target:self action:@selector(inputaccessoryviewdidfinish)]; donebutton.tintcolor = [uicolor clearcolor]; [mytoolbar setitems:[nsarray arraywithobject: donebutton] animated:no];  self.quantityfield.inputaccessoryview = mytoolbar; 

to make sure close picker view when done button clicked implemented following function (which added action donebutton.

- (void)inputaccessoryviewdidfinish {     [self.quantityfield resignfirstresponder];    } 

each picker set show numbers 0-10 (11 rows).

i have added repo of same working fine, monkey tested it!

if still problem persists, make changes in repo per current app has issue , further!


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -