In a function overridden from the immediate superclass, an exc_bad_access is being thrown when the function tries to call the superclass version of itself. The execution does not make it into the superclass’ function, but instead throws the signal from objc_msgSend. The class and both parameters are as expected. The call does not fail if expired is true, nor does the superclass function fail when called elsewhere.
- (void)customizeCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
if (expired)
{
//do some things
}
else
{
//fails here
[super customizeCell:cell atIndexPath:indexPath];
}
}
Turns out there was an assignment error in the supercall. I was supposed to be assigning a new variable to a cast of a parameter, but instead assigned it be itself. This predictably crashed when called from the subclass implementation. If called directly, this actually the variable to be the parameter, the intended behaviour. Adding logging statements to the function or changing the compiler flags change this behaviour, so it seems that this was just a fluke with garbage memory.