I’m a new iPhone developer (of about 4 months or so) who is starting to look at Core Data.
In the “Beginning iPhone 3 Development” book by Dave Mark it mentions that the main difference between fetched properties and relationships is that fetched properties allow lazy loading. However, I have seen other resources and accepted answers on this site which suggest that relationships do allow lazy loading.
For example, if I have a Department object with a to-many relationship with Employee then I would not want a fetch on a given Department to load all the associated employees into memory.
I would be extremely grateful for an authoritative answer on this point, and on the other differences, as it has obvious implications on any design.
Also, I would be extremely grateful if someone could point me towards a reasonable Core Data resource that is a clear and beginner friendly guide (I have been a Java Developer previously but I am new to the iPhone-Way…
Check out faulting in Core Data:
Using faults, if you retrieve a single Employee object from a persistent store its manager, department, and reports relationships are initially represented by faults. Although the fault is an instance of the Department class, it has not yet been realized—none of its persistent instance variables have yet been set.
If you send the Department object a message to get, say, its name, then the fault fires—and in this situation Core Data executes a fetch for you to retrieve all the object’s attributes.