I have the following code to remove all objects having 'sever' value equal to -1. My code is as follows:
NSMutableArray *sortedArray = [[NSMutableArray alloc] initWithArray:self.allInteractions];
//Removing all interactions with severity equal to -1
NSPredicate *severityPredicate = [NSPredicate predicateWithFormat:@"sever != %@", @-1];
[sortedArray filterUsingPredicate:severityPredicate];
This is working fine on iOS 11 device and simulators. It is working good on iOS 9 and 10 simulators as well. But when I tried installing it on iPad(iOS 9.2) and iPhone 5 (10.3.3), it crashes with:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x918038d0)
and also displays the following warning on console:
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
I can't figure out what is going wrong here.
UPDATE
I've enabled zombie objects and it logs
[CFNumber isEqual:]: message sent to deallocated instance 0x18d0b0b0
self.allInteractions is an array of the following class:
@interface Interaction : NSObject
@property (nonatomic, strong) NSString *class1;
@property (nonatomic, strong) NSString *subject;
@property (nonatomic, strong) NSString *object;
@property (nonatomic, strong) NSString *details;
@property (nonatomic, assign) NSNumber *sever;