구현에 따라 다릅니다. 일반적으로 실행 취소 관리자는 이벤트에 대한 실행 취소 그룹을 열고 변경 사항을 캡슐화합니다 (groupsByEvent 참조). 백그라운드 동기화를 위해 보조 관리 객체 컨텍스트를 사용하고 컨텍스트를 다시 주 컨텍스트에 병합하는 경우 실행 취소 등록을 비활성화했는지 확인해야합니다 (disableUndoRegistration 참조).
편집 : 여기에 당신이 작성하지 않고 별도의 맥락에서 동기화 할 수있는 작은 코드 조각 작업을
// create a child context with no undo manager
NSManagedObjectContext *context = [NSManagedObjectContext contextWithParent:self.managedObjectContext];
context.undoManager = nil;
[... do your synchronization with the child context...]
// merge into main context without generating undo actions
[undoManager disableUndoRegistration];
[context save:&error];
[managedObjectContext processPendingChanges];
[undoManager enableUndoRegistration];
// to prevent undo action beyond the synchronization to remove all undo actions
[undoManager removeAllActions];
+1 당신이 답을 찾으셨습니까을 취소입니까? – surlac
아니 슬프게도 : (여전히 호기심이 많은 손상을 할 가능성이 있기 때문에 – PaReeOhNos