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/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

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

I can confirm it is fixed in svn.
Thanx.

-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:

NSInPredicateOperatorType

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
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by yjchen (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 20 Jun 2007 04:26:54 AM UTCCaSOpen/ClosedIn Test=>Closed
    Thu 14 Jun 2007 05:20:50 AM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1