Re: Document style programming
Re: Document style programming
- Subject: Re: Document style programming
- From: Luther Baker <email@hidden>
- Date: Sat, 18 Oct 2014 11:33:20 -0500
As an aside, I'm sure it is well-known, there is some funny caching going
on.
If I open the app the first time (and pre-populate the context with data) -
I cannot actually "SAVE".
If I formally shut the app down by quitting the app and choosing "Don't
Save", then subsequent restarts exhibit the same behavior.
BUT, if I simply rerun the app from Xcode (with the app still running) --
then subsequent SAVES on the context actually work --- or at least they
don't complain about not having an attached datastore.
In fact, the block of code that creates the temp data is based on the
existence of data in the database and it doesn't run on subsequent Xcode
restarts ... which implies that when restarting the app from Xcode, the
environment tries to "remember" data I've created (and not yet saved).
Something was cached in the restart and now there is a persistent store of
some sort, albeit still nothing that I explicitly saved anywhere. Sort of
trippy unless you expect or understand why.
At any rate, thanks for the clarifications!
-Luther
On Sat, Oct 18, 2014 at 11:11 AM, Mike Abdullah <email@hidden>
wrote:
>
> > On 18 Oct 2014, at 17:09, Luther Baker <email@hidden> wrote:
> >
> > Thanks Mike.
> >
> > Let me ask another question ... what if I need to create a temporary,
> thread specific NSManagedObjectContext? Let's say I'm interacting with a
> RESTful API ala AFNetworking and I need to parse and save data on a
> background response thread.
> >
> > How do I tie my thread specific context into the Document's datastore?
>
> These days, I daresay Apple would like you to split off a temporary child
> context that saves directly into its parent context (rather than the old
> way of two contexts sharing a persistent store coordinator).
>
>
_______________________________________________
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