FROM : Grigory Entin
DATE : Thu Nov 22 16:18:33 2007
Hello Mike,
On Thu Nov 22 2007 at 14:01, Mike Abdullah <<email_removed>> wrote:
> You can "join" it with the previous undo like so:
>
> NSManagedObjectContext *moc = [self managedObjectContext];
> [moc processPendingChanges];
> [[moc undoManager] disableUndoRegistration];
>
> Do the work here
>
> [moc processPendingChanges];
> [[moc undoManager] enableUndoRegistration];
Thanks a lot, Mike!!! It works!
Though, frankly I don't understand why it results in the "join"..
I do understand from the documentation that -processPendingChanges
should record the pending changes in the undo manager, but I think it
should be "nop" if undo registration is disabled. But as far as I see
now, I'm wrong..
Is it some magic? Is -processPendingChanges a "priveleged" method that
results in the "join" if undo registration is disabled, due to some
inner "contract" between moc and undo manager? Or is it just some
aspect of undo manager that I don't understand? It just doesn't fit in
my head..
Regards,
Grigory
DATE : Thu Nov 22 16:18:33 2007
Hello Mike,
On Thu Nov 22 2007 at 14:01, Mike Abdullah <<email_removed>> wrote:
> You can "join" it with the previous undo like so:
>
> NSManagedObjectContext *moc = [self managedObjectContext];
> [moc processPendingChanges];
> [[moc undoManager] disableUndoRegistration];
>
> Do the work here
>
> [moc processPendingChanges];
> [[moc undoManager] enableUndoRegistration];
Thanks a lot, Mike!!! It works!
Though, frankly I don't understand why it results in the "join"..
I do understand from the documentation that -processPendingChanges
should record the pending changes in the undo manager, but I think it
should be "nop" if undo registration is disabled. But as far as I see
now, I'm wrong..
Is it some magic? Is -processPendingChanges a "priveleged" method that
results in the "join" if undo registration is disabled, due to some
inner "contract" between moc and undo manager? Or is it just some
aspect of undo manager that I don't understand? It just doesn't fit in
my head..
Regards,
Grigory
| Related mails | Author | Date |
|---|---|---|
| Grigory Entin | Nov 22, 04:40 | |
| Mike Abdullah | Nov 22, 12:01 | |
| Grigory Entin | Nov 22, 16:18 |






Cocoa mail archive

