Creating an NSExpression with a keypath and variable
Creating an NSExpression with a keypath and variable
- Subject: Creating an NSExpression with a keypath and variable
- From: Kyle Sluder <email@hidden>
- Date: Wed, 16 Mar 2011 11:20:49 -0700
Hi all,
Is it really impossible to create an NSExpression of the form
"$variableName.someKeyPath"? I can create an NSExpression for
$variableName, and I can create an NSExpression for someKeyPath, but I
can't create one that contains both.
The actual problem is that I'm trying to create an NSPredicate for
"SUBQUERY(events, $x, $x isKindOfClass: %@ AND $x.text CONTAINS[cd]
$searchString).@count != 0". Since the method in question is called
periodically (it's the action method of a filter control), I was
hoping to create a static variable-based NSPredicate, rather than
reconstruct the predicate every time this method gets called. But that
didn't work because it didn't descend into the subquery's subpredicate
to replace $searchString.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden