Re: Core Data & ManagedObjectContext
Re: Core Data & ManagedObjectContext
- Subject: Re: Core Data & ManagedObjectContext
- From: William Turner <email@hidden>
- Date: Wed, 23 Jan 2008 17:25:24 -0800
Hi Phil,
I'm not sure why you want a different context for each window. Each
context is a separate "scratchpad" for the underlying data store - do
you really *want* to perform edits in separate contexts? That often
results in additional complexity merging changes, etc., between the
contexts. If you just want to be able to access the store via more
than one nib, you should be able to make the application delegate's
context available to all of those nibs.
For your second question - when a text field is bound you can have it
continuously update the model or only when editing ends. You can also
implement validation methods in the model object. If you want to
involve an action before the data is sent to the model, then bindings
may not be your solution - you may want to implement that part of your
app with target-action instead.
I'm not completely clear on either of your problems/goals - if the
answers I gave aren't sufficient maybe you could describe what you
want to do in greater detail.
Wil
On Jan 23, 2008, at 12:43 PM, Philip Bridson wrote:
Hi there,
If I create an managedObjectContext for each of my windows in an
application, and pass in the persistent store co-ordinator for the
application will this allow me to edit information in the store via
separate nibs as at the moment it will only let me bind to the
applications delegate. Also, if I bind an NSTextField to the
NSArrayController, it automatically stores the information that is
supplied, how can I pass the information to a method first,, say by
clicking OK, BEFORE submitting the information to the
NSArrayController?
Many Thanks,
Phil.
_______________________________________________
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
_______________________________________________
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