• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate


  • Subject: Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 14 Oct 2014 12:43:45 -0700

> On 2014 Oct 14, at 05:42, Devarshi Kulshreshtha <email@hidden> wrote:
>
> I am trying to implement reset functionality in core data based sample app.
>
> I think that there are two ways to implement reset functionality:
>
> Approach 1: Delete sqlite file and then re-insert data

As you’ve seen, this is tricky to do without relying on some Apple-impleentation-dependent behaviors.

> Approach 2: Retrieve all data in managedObjectContext, delete
> retrieved data  and then re-insert data

Performance may be unacceptable, and people will disrespect your code :)

* * *

How about a third approach: perform a managed object context reset(), followed by a save().  Does that work?

Finally, if you’re in the modern world of Yosemite or iOS8, maybe some of the new direct database access methods will do what you want.


_______________________________________________

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


  • Follow-Ups:
    • Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate
      • From: Devarshi Kulshreshtha <email@hidden>
References: 
 >Swift - Basic query regarding managedObjectContext method invocation from app delegate (From: Devarshi Kulshreshtha <email@hidden>)

  • Prev by Date: Re: Table of TextViews
  • Next by Date: Custom NSView for Selection Rect...
  • Previous by thread: Swift - Basic query regarding managedObjectContext method invocation from app delegate
  • Next by thread: Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate
  • Index(es):
    • Date
    • Thread