objective c - ios: Textfield duplicates data in uitableview -
data textfield duplicates in tableview cell whenever scroll tableview. textfield repeated every 6 rows again & again.
how remove duplicate data textfield using custom cell.
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *identifier= @"productcell"; placeordertableviewcell * productcell = [productstblview dequeuereusablecellwithidentifier:identifier]; if (productcell==nil) { productcell = [[placeordertableviewcell alloc]initwithstyle:uitableviewcellstyledefault reuseidentifier:identifier]; } }
it's not duplicate data, using uitableviewcell incorrectly. performance reasons cells reused after go offscreen, uitableviewcell should used display data model , when gets reused previous data replaced 1 new data model entity
you should add bit more information question, how setting values of cells?
edit
if need value uitextfield should implement uitextfielddelegate textfielddidendediting: should take @ answer explains simple uitableview uitextfield implementation.
also answer interesting tutorials might want check
Comments
Post a Comment