Simply use
[NSPredicate predicateWithFormat:@"forAppointment = %@", appointment]
Using the objectID
is only necessary if appointment
is from a different managed object
context. In that case
[NSPredicate predicateWithFormat:@"forAppointment = %@", [appointment objectID]]
should work. (The right-hand side of == %@
can be a managed object or its object ID.
You don't have to specify "objectID" in the predicate itself.)