Re: Core Data - fresh data for text field not connected to array controller
Re: Core Data - fresh data for text field not connected to array controller
- Subject: Re: Core Data - fresh data for text field not connected to array controller
- From: Steve Steinitz <email@hidden>
- Date: Sat, 27 Dec 2008 18:19:48 +1100
Hi mmalc,
Thanks for your reply. I've answered your questions below.
On 26/12/08, mmalc Crawford wrote:
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.
(a) What did you bind to?
A managedObject singleton ivar, accessed via a getter method
that does the reset, refreshObject:mergeChanges etc i.e, preferencesController.preferences.attributeName
(b) Have you tested to ensure that the managed object is being updated?
Good point. I only reset and refresh the managedObject when
something asks for it. Per your question, I changed my testing
to force it, by other means, to update and only then do I check
the textField for fresh data. The results were that I confirmed
that the managedObject is fresh but the textField doesn't show
the change.
- Did you use refreshObject:mergeChanges:?
Yes.
- If so, is the context's staleness interval exceeded?
Yes. But I may add code that I use elsewhere to set the
staleness interval, temporarily, to the shortest value. That
said, at this point it appears that I have an update problem
since the managedObject has fresh data.
Thanks again for your reply, mmalc. Confirming that the
managedObject itself was fresh was a helpful idea. It also made
me notice that some part of the freshening process is causing an
optimistic locking error. More investigation...
Any further ideas appreciated.
Cheers,
Steve
_______________________________________________
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