I am having a problem with core data which seems to be behaving differently on the device and simulator.
I have a very simple UITableView which is driven from a core data model, there are minimal changes from the apple-supplied template.
On the simulator, everything works fine. On the device, I have the correct number of cells in the table view to match the number of managed objects in the database, but the cells themselves contain no data. I have a couple of labels in the cell which are derived from transient properties of the managed object, and these are blank.
I have NSLog statements on the awakeFromFetch method of my managed object subclass, and the cellForRowAtIndexPath method of my table view delegate.
On the simulator, awakeFromFetch is called before cellForRowAtIndexPath, so everything is fine. On the device, it is the other way around, so the cells are blank until I force them to be redisplayed by scrolling up and down.
Why is this happening, and what changes should I make to prevent it? I can see if the managed object is a fault during the cell configuration code, but how do I force the fault to fire? Or should I be doing something else?
I have solved this by ensuring that I configure my cell by calling on a persistent property of the managed object first. This fires the fault and populates the rest of the fields. The transient properties were being populated in awakeFromFetch and this is not called until the fault is fired. Why this is different on the device and simulator, I do not know.