iphone - how can i recognise and check selected option in uipickerview from the content of the textfield related to that uipickerview -


my problem when try recognise content of textfield of uipickerview , try check option content equal content of textfield, if options more 3 options , selected option fourth or after checkmark not created , nothing checked. made pickercell class( uiview contain checkmark) determine option selected. in class implement delegates of uipickerview , generate ui, made check selected option :

for (int = 0; < [self.custompickerview numberofrowsincomponent:0]; i++) {     pickerviewcell *label = (pickerviewcell *)[self.custompickerview viewforrow:i forcomponent:0];     (int j = 0; j < [self.selecteditems count]; j++) {         if ([(nsstring *)[self.selecteditems objectatindex:j]              isequaltostring:(nsstring *)[self.options objectatindex:i]]) {             label.checkmarkview.hidden = no;         }     }     } 

and in pickerview delegate made :

pickerviewcell *label = (pickerviewcell *)view;     self.custompickerview.showsselectionindicator   = no;     // add gesture recognizer detect taps in pickerview     uitapgesturerecognizer *multipletap = [[uitapgesturerecognizer alloc]                                             initwithtarget:self                                                     action:@selector(tapmultipleinpickerview:)];     [multipletap setnumberoftapsrequired:1];     //[singletap setnumberoftouchesrequired:1];     [self.custompickerview addgesturerecognizer:multipletap];     if (!label)     {         // customize label (or other type uiview) here         label = [[pickerviewcell alloc]                  initwithframe:cgrectmake(0.0f, 0.0f, self.custompickerview.bounds.size.width * 0.8, 44.0f)];     }     if (row < [self.options count])     {         label.label.text = (nsstring *)[self.options objectatindex:row];         //label.checkmarkview.hidden = !(row == self.currentoption);     }     return label; 

any appreciated. thanks.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -