Core Data - fresh data for text field not connected to array controller
Core Data - fresh data for text field not connected to array controller
- Subject: Core Data - fresh data for text field not connected to array controller
- From: Steve Steinitz <email@hidden>
- Date: Sat, 27 Dec 2008 16:48:18 +1100
Hello,
I'm using core data (sqlite) in a multi-user environment. With
a little tweaking, each machine now has fresh data when it
counts -- at least when I bind text fields (etc) to array
controllers of managed objects -- the KVO seems to work almost
by magic.
However, I have one entity that has only one record (for user
preferences). I fetch the record fresh into its very own
managedObjectContext for each access -- and even resetting the
managedObjectContext. That direct binding, bypassing an
arrayController, Never discovers database changes once the
Preferences window is created.
I've tried a number of things including refreshObject, calling
willChange and didChange for specific attributes of the
preference record, releasing and nilling the preference record,
performPendingChanges... all to no avail. I've thrown
everything I can think of at it -- nothing results in fresh
data. Obviously I can fetch fresh data but the textfields etc
never update themselves.
How can I get the preference fields to get fresh data from the database?
Thanks,
Steve
ps. a couple of weeks ago someone posted that even after an MOC
reset they still had stale data. I smugly replied that an MOC
reset should do the trick. My apologies -- I'm chastened.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden