Last active
August 29, 2015 13:57
-
-
Save tomassliz/9413208 to your computer and use it in GitHub Desktop.
BOOL value behaviour with high optimization level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
BOOL isMember = NO; // here must be variable set to no, otherwise is initialized to thrash | |
for (NSIndexPath *ip in self.expandedCells) { | |
if ([ip isEqualToIndexPath:indexPath]) { | |
isMember = YES; | |
break; | |
} | |
} | |
if (isMember) { | |
[self.expandedCells removeObject:indexPath]; | |
} else { | |
[self.expandedCells addObject:indexPath]; | |
} | |
[tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment