I am not quite sure how to word this question without explaining what I am trying to do.
I have a managed object context filled with (essentially) circles that have an x,y coord for the center point and a radius.
I would like to construct a predicate for my core data retrieval that will find all circles that overlap with a given circle.
I can write a boolean method that tests this and returns true or false, but my problem is that I don’t know how to call this testing method in my predicate.
in pseudo-code, I am trying to do this:
NSPredicate *pred = [NSPredicate (if [testOverlapWithCenterAt:centerOfGivenObjectInContext andRadius:radiusOfGivenObjectInContext]);
Perhaps NSPredicate isn’t even the best way to do this. Any help would be much appreciated.
You can use the
predicateWithBlockinstance method ofNSPredicate. Give it a try.