FROM : Simon Liu
DATE : Tue Dec 20 17:32:15 2005
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
DATE : Tue Dec 20 17:32:15 2005
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
| Related mails | Author | Date |
|---|---|---|
| Simon Liu | Dec 20, 17:32 | |
| Justin Burns | Dec 20, 20:30 | |
| mmalcolm crawford | Dec 20, 20:38 | |
| Chris Hanson | Dec 20, 21:03 | |
| Simon Liu | Dec 20, 23:25 | |
| pyunpyun | Dec 21, 04:21 | |
| mmalcolm crawford | Dec 21, 05:24 | |
| pyunpyun | Dec 21, 18:52 |






Cocoa mail archive

