Selected Property and NSPredicate

I know how to use NSPredicate with relationships, but for some reason, when I do the same with the property being retrieved, I get:

Application terminated due to uncaught exception "NSInvalidArgumentException", reason: "keypath address.id not found ...", where address is the selected property.

The code looks like this:

[NSPredicate predicateWithFormat: @ "address.id == '% i'", id]

Can you use the extracted properties with NSPredicate?

+2


source to share


1 answer


Have you tried [NSPredicate predicateWithFormat: @ "address.id ==% @", [NSNumber numberWithInt: id]];



if you have an address as an object, @ "address ==% @", addressObject should suffice.

+2


source







All Articles