-(IBAction)stretchAction:(NSInteger)index
{
OrderSummaryInfo *info = [self.dataArray objectAtIndex:index];
NSInteger insertCount = info.orderItemArray.count;
info.isOpen = !info.isOpen;
NSMutableArray *arr = [NSMutableArray array];
[arr removeAllObjects];
for (int i=0; i<insertCount; i++) {
NSIndexPath *path = [NSIndexPath indexPathForRow:i+1 inSection:index];
[arr addObject:path];
}
[self.tableView beginUpdates];
if (info.isOpen) {
[self.tableView insertRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationTop];
}else{
[self.tableView deleteRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationTop];
}
[self.tableView endUpdates];
}