Xcode 13.3.1/iOS15.5 filteredArrayUsingPredicate: Crash

Code that works w/ any iOS and Xcode 12, and also works w/ Xcode 13.3.1 and iOS15.4 and earlier....does not work with Xcode 13.3.1 and iOS15.

          NSPredicate *myButtonPredicate = [NSPredicate predicateWithFormat:@"self.accessibilityLabel = %@",@"My Button"];             if ([arrayOfButtons filteredArrayUsingPredicate:myButtonPredicate].count == 0

I get a SIGABRT w/o any other debug info on the 2nd line of that code sample.

Did something change w/ NSPredicate/NSArray/NSPredicateSupport?

I get a SIGABRT w/o any other debug info on the 2nd line of that code sample.

Presumably this crashes even when you run your app outside of Xcode, directly from the home screen. If so, please do that, grab the resulting crash report, and post it here. See Posting a Crash Report for advice on that last bit.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

We were able to work around this issue by using predicateWithBlock:

      NSPredicate * myButtonPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
        return ([evaluatedObject isKindOfClass:UIBarButtonItem.class] && [((UIBarButtonItem *)evaluatedObject).accessibilityLabel isEqualToString:@"My Button"]);
      }];
Xcode 13.3.1/iOS15.5 filteredArrayUsingPredicate: Crash
 
 
Q