objective c - Core Data: force one attribute to load before others -
i have transient attributes in entity derived 1 other transient attribute (call x). when fetch, seems try load attributes in no particular order, if x taking time calculate, other derived attributes try use x , it's null causes issues.
is there way force core data ensure loading 1 attribute before other attributes can read it? or force other attributes reload once attribute x has done loading? other technique recommend? i'm using in ios tableview backed nsfetchedresultscontroller.
no can't force attributes "load" in order because attributes don't load. initializing objects here , not reading cells in procedural database.
i'm going guess trying calculate value based on attributes or counts of external objects. if so, can serious slow downs while other objects faulted in values can accessed.
if so, you've got data model design problem. i've never seen transient value complex calculation impaired operation. need break apart or move own object.
e.g suppose you've got data model simulates group of people person
objects. want behavior of each person
object change depending on how many people are. so, when there less 5 each person "x" if there 6 10 "y" , on.
in circumstance, best create second entity related person
objects tracks number of person
objects total. getting count of person
objects or collective sum of 1 of person
entity attributes becomes fast , trivial.
Comments
Post a Comment