URL:
<http://savannah.gnu.org/bugs/?20169>
Summary: NSPredicate failed to find substring with 'IN'
operation
Project: GNUstep
Submitted by: yjchen
Submitted on: Wednesday 06/13/2007 at 19:06
Category: Base/Foundation
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
'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.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?20169>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnustep