Re: wrapping my head around NSPredicate
Re: wrapping my head around NSPredicate
- Subject: Re: wrapping my head around NSPredicate
- From: Charilaos Skiadas <email@hidden>
- Date: Fri, 29 Jul 2005 14:27:03 -0500
So, you have a particular instance of classA, let's call it objA, and
you want to find the instances of classB whose NamePK matches objA.
Then I think this code I linked in the previous message should do it:
-(NSPredicate *)predicate
{
NSPredicate *thePredicate = [NSPredicate
predicateWithFormat:@"NamePK == %@" argumentArray:[NSArray
arrayWithObject:instanceA]];
return thePredicate;
}
On Jul 29, 2005, at 11:17 AM, Zameer Andani wrote:
Thanks Charilaos, and list...
I am trying to match NamePK to a particular instance of classA. i
realize the method is not complete as I still need to return the
NSPredicate*
What I'm trying to avoid is having to write the following (which is
what i have right now), as it is extremely coupled with the layout
of ClassA:
id value1 = [NamePK valueForKey:@"FirstName"];
id value2 = [NamePK valueForKey:@"LastName"];
[predicateFormat appendFormat: @"NamePK.FirstName == %@ And
NamePK.LastName == %@", value1, value2];
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden