views:

17

answers:

1

When an managed object is fetched, and the staleness interval is set to 5 minutes, what happens after 10 minutes, when I access an property of that object?

Would Core Data then perform a fresh fetch request? Does that make sense? I can't think of a situation where data is already cached but the object is a fault. When can this happen?

+1  A: 

From Core Data Programming Guide: Using Managed Objects

Note that an object's staleness interval is the time that has to pass until the store re-fetches the snapshot. This therefore only affects firing faults—moreover it is only relevant for SQLite stores (the other stores never re-fetch because the entire data set is kept in memory).

It only affects full fledged objects i.e. those that are NOT faults (ghost objects with no populated attributes.)

You really only need to fiddle with this in a complex setup where you have multiple context all changing the store simultaneously. On iOS apps, this is rarely necessary.

TechZen
now that's confusing - i thought a fault IS a ghost?
dontWatchMyProfile
They are. However, "firing a fault" means to populate the objects attributes. If faults are "ghost" then "firing a fault" and "faulting" both mean "to materialize" or "to make concrete." The terminology evolved over several decades and is rather confusing. A lot of writers get it backwards which just makes it worse.
TechZen