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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -