• 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
CoreData - Fast Deletion Of Thousands Of ManagedObjects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData - Fast Deletion Of Thousands Of ManagedObjects?


  • Subject: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
  • From: Simon Liu <email@hidden>
  • Date: Tue, 20 Dec 2005 16:32:15 +0000

I have a tableview representing managed objects. If I select all the
managed objects e.g.10,000, and delete them from the
managedObjectContext, there is a long delay e.g. 30 seconds.

Is there a way to delete large numbers of objects from a context
quickly and avoid the spinning beach ball? I don't really want to
have to delete the objects in a background thread, or put up a panel
saying 'Deletion in progress'.

My managed objects have relationships with nullify and cascade
deletion rules. My deletion code looks something this:

id undoManager = [[context undoManager] retain];
[context setUndoManager:nil];

while (obj = [enumerator nextObject]) {
[context deleteObject:obj];
}

[context setUndoManager:[undoManager autorelease]];

Appreciate any tips. Thanks.
--Simon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
      • From: email@hidden
    • Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
      • From: Justin Burns <email@hidden>
  • Prev by Date: Re: Implementing a scrollable icon-table
  • Next by Date: Re: Text Wrap in NSBeginCriticalAlertSheet
  • Previous by thread: Re: Sizing NSMatrix
  • Next by thread: Re: CoreData - Fast Deletion Of Thousands Of ManagedObjects?
  • Index(es):
    • Date
    • Thread