I'm trying to set up an "IN" predicate like this:

    NSArray* deletedAlertIDs = @[ @198, @197 ];
    NSPredicate* pred =
        [NSComparisonPredicate predicateWithLeftExpression: [NSExpression 
expressionForKeyPath: @"keyShadow"]
            rightExpression: [NSExpression expressionForAggregate: 
deletedAlertIDs]
            modifier: NSDirectPredicateModifier
            type: NSInPredicateOperatorType
            options: 0];
    req.predicate = pred;

But it doesn't work, even though NSLog() shows it as "keyShadow IN {198, 197}", 
which is the same as what I get when I use this code that works:


    req.predicate = [NSPredicate predicateWithFormat: @"keyShadow IN %@", 
deletedAlertIDs];

Clearly something is different between the two that's not shown in the 
description.

-- 
Rick




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to