First of all the crash is pretty self explanatory. You are actually mutating (aka. replacing an object in the array), while the fast enumeration is still in progress, which is not permitted.
The solution if you would go with your design would be to actually capture the index of the object, break the fast enumeration and replace the object outside the fast enumeration.
However what you are doing is not correct. The way to use the indexOfObjectPassingTest is this:
NSInteger indx = [[DataModel sharedInstance].testResultList indexOfObjectPassingTest:^BOOL(TestResult *obj, NSUInteger idx, BOOL *stop) {
return [obj.name isEqualToString:name];
}];
if (indx != NSNotFound) {
[[DataModel sharedInstance].testResultList replaceObjectAtIndex:indx withObject:result];
}
You don't need to manually enumerate through all elements of the array. The function does this for you internally.