• 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: Correct way to have nil undo manager in Core Data document?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Correct way to have nil undo manager in Core Data document?


  • Subject: re: Correct way to have nil undo manager in Core Data document?
  • From: Ben Trumbull <email@hidden>
  • Date: Sat, 29 Aug 2009 17:29:31 -0700

Well, I've got a background worker process which opens an
NSPersistenDocument.  Since it has no "undo" capability, I want to set
it to nil as recommended.  (I have other reasons for not wanting an
undo manager scurrying around.)  But the document doesn't like having
nil undo manager.  When I ask for it later, it creates one for itself,
and sets its managed object context to have the same one.


You need to use the NSDocument API:

/* The document's undo manager. The default implementation of - setUndoManager:, in addition to recording the undo manager, registers the document as an observer of various NSUndoManager notifications so that -updateChangeCount: is invoked as undoable changes are made to the document. The default implementation of -undoManager creates an undo manager if the document does not already have one and - hasUndoManager would return YES. */
- (void)setUndoManager:(NSUndoManager *)undoManager;
- (NSUndoManager *)undoManager;


/* Whether or not the document has an undo manager. The default implementation of -setHasUndoManager: releases the document's current undo manager if it has one before the invocation but is not to have one afterward. */
- (void)setHasUndoManager:(BOOL)hasUndoManager;
- (BOOL)hasUndoManager;



- Ben



_______________________________________________

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: Correct way to have nil undo manager in Core Data document?
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Standard Alert Note/Warning/Stop icon NSImage Names?
  • Next by Date: re: Core Data Predicate Builder - comparing dates
  • Previous by thread: Re: Correct way to have nil undo manager in Core Data document?
  • Next by thread: Re: Correct way to have nil undo manager in Core Data document?
  • Index(es):
    • Date
    • Thread