Is there a Core Data predicate for all objects in a linked list? -
is there way formulate core data predicate given object, representing head of singly linked list, , of other objects in list?
e.g., have objects, each of has relationship object (say nextobject) , want predicate specified object , other objects reachable traversing nextobject (until nil).
clarification:
i'm using these uitableview's nsfetchedresultscontroller, these need part of fetch, not iterate through in code.
you wouldn't use predicate linked list. instead, start first object of interest , walk relationships calling nextobject until hit 1 did not have nextobject value.
you can find first , last objects predicate in fetch looking previousobject==nil , nextobject==nil.
predicates not understand arbitrarily long relationship chains. understand chain enity1.entity2.entity3 not nextobject.nextobject.nextobject... because have no way of knowing when stop.
Comments
Post a Comment