iphone - Selecting multiple values shuffle when scrolled: UICollectionView -


trying select multiple cells in uicollectionview , when scrolled selection c hanges. why happening, please guide. below code. tried.

- (void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { printf("selected view index=%d",indexpath.row);  itempaths  = [self.collectionview indexpathsforselecteditems];  uicollectionviewcell* cell=[self.collectionview cellforitematindexpath:indexpath]; cell.contentview.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"blue_s.png"]]; }  - (void)collectionview:(uicollectionview *)collectionview diddeselectitematindexpath:(nsindexpath *)indexpath { uicollectionviewcell* cell=[self.collectionview cellforitematindexpath:indexpath]; cell.contentview.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"yellow_seat.png"]];  } 

what else should try.

you can 1 thing solve problem can give tag each cell using custom cell of uicollection view have unique identity


Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -