objective c - IOS Disable UItableview Selection on All Cells but one Cell -



objective c - IOS Disable UItableview Selection on All Cells but one Cell -

how can 1 disable selection on uitableviewcell's except 1 in uitableview.

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { // deselect row [tableview deselectrowatindexpath:indexpath animated:yes]; // nslog(@"row selected = %li",(long)indexpath.row); self.selectedinviteduserid = [[self.vieworderuserarray valueforkey:@"inviteduserid"] objectatindex:[indexpath row]]; nslog(@"row selectedinviteduserid = %@",self.selectedinviteduserid); if( self.selectedinviteduserid && [indexpath row] != 0 ) { if ([[self.viewselecteditemsarray lastobject] count] == 0) { [self performseguewithidentifier:@"delimenufromvieworderlist" sender:self]; } else { [self performseguewithidentifier:@"viewordersummaryfromorderdetails" sender:self]; } } }

i know of disable cells.

cell.selectionstyle = uitableviewcellselectionstylenone;

you need in

(uitableviewcell *)tableview:cellforrowatindexpath:

callback. setting on cell executed when tapped. not should seek manually manage

like so:

// indexpath != 0 points row want enable if( self.selectedinviteduserid && indexpath != 0 ) { [cell setselectionstyle:uitableviewcellselectionstylenone]; } else { [cell setselectionstyle:uitableviewcellselectionstyleblue]; }

note

this stop beingness highlighted. need check within didselectrowatindexpath: callback if right row.

ios objective-c uitableview didselectrowatindexpath

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -