I have to get the IndexPath values to the NSMutableArray. I have to do an operation when a particular cell is selected at that time it's IndexPath is stored in NSMutableArray and particular cell height is increasing. When I am pressing again on the that cell at that time particular cell height is decreasing. How can it possible and what type of condition do I have to put?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%@",indexPath);
selectIndexPathCell = indexPath;
NSIndexPath *previousSelectedIndexPath = selectIndexPathCell;
selectIndexPathCell = indexPath;
if (previousSelectedIndexPath) {
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:previousSelectedIndexPath]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:selectIndexPathCell]
withRowAnimation:UITableViewRowAnimationAutomatic];
self.selectedRow = sections_main[indexPath.section][@"content"][indexPath.row];
[tblPeople beginUpdates];
[tblPeople endUpdates];
}
- (CGFloat)tableView:(UITableView *)aTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(selectIndexPathCell != nil && [selectIndexPathCell compare:indexPath] == NSOrderedSame){
return 80;
}else{
return 60.0;
}
}