I have a UITableView with about 20 cells. I wanted to make a pointer to three of those cells, so I set up a property for those, then pointed them to those cells:
if ([item.title isEqualToString:@"Test1"]) {
test1 = cell;
} else if ([item.title isEqualToString:@"test2"]) {
test2 = cell;
}
If I scroll up and down in my table view over and over it will crash my app. But, removing this pointer code fixes the crashing issue.
Why would making a pointer to a cell make my app crash?
Edit:
if ([item.title isEqualToString:@"Test1"]) {
self.test1 = cell;
} else if ([item.title isEqualToString:@"test2"]) {
self.test2 = cell;
}
I just updated my code to use self. and it seems to fix the crashing issue. Could this be true?