bugGNUstep - Bugs: bug #20169, NSPredicate failed to find...


You are not allowed to post comments on this tracker with your current authentication level.

bug #20169: NSPredicate failed to find substring with 'IN' operation

Submitted by:  -Deleted Account- <yjchen>
Submitted on:  Wed 13 Jun 2007 11:06:49 PM UTC  
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Wed 20 Jun 2007 01:00:40 AM UTC, comment #2:

I can confirm it is fixed in svn.

-Deleted Account- <yjchen>
Thu 14 Jun 2007 05:20:50 AM UTC, comment #1:

I think I fixed this in svn trunk ... please let me know if the change is OK.

Richard Frith-Macdonald <CaS>
Project Member
Wed 13 Jun 2007 11:06:49 PM UTC, original submission:

'CONTAINS' works:

NSString *string = @"AABBBAA";
p = [NSPredicate predicateWithFormat: @"%@ CONTAINS %@", @"AABBBAA", @"BBB"];
UKTrue([p evaluateWithObject: string]);

But 'IN' fails:

NSString *string = @"AABBBAA";
p = [NSPredicate predicateWithFormat: @"%@ IN %@", @"BBB", @"AABBBAA"];
UKTrue([p evaluateWithObject: string]);

Here is the description of 'IN' for Cocoa:


A predicate to determine if the left hand side is in the right hand side.

For strings, returns YES if the left hand side is a substring of the right hand side . For collections, returns YES if the left hand side is in the right hand side .

Available in Mac OS X v10.4 and later.

-Deleted Account- <yjchen>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by yjchen (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-06-20 CaS Open/ClosedIn Test => Closed
    2007-06-14 CaS StatusNone => Fixed
        Open/ClosedOpen => In Test

    Back to the top

    Powered by Savane 3.4