iOS How to expand only one cell -


i have try write first app , have encountered problem seems not able find solution.

i trying expand cell height that's being tapped. followed link when clicked on 1 cell, rest of cells expanded too. know why happening?

here simple implementation of problem.

#import "viewcontroller.h"  @interface viewcontroller ()<uitableviewdatasource,uitableviewdelegate> {     nsindexpath *selectedindexpath; }  @end  @implementation viewcontroller  - (void)viewdidload {     [super viewdidload];     selectedindexpath = [nsindexpath new]; }  - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     return 10; }  - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"mycell"];     return cell; }  - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath {      if ( indexpath == selectedindexpath)     {         return 200;     }     else     {         return 90;     }  }  - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     selectedindexpath = indexpath;     [tableview reloaddata]; } @end 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -