• 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: Making an initial change to document, and don't want the doc marked as changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making an initial change to document, and don't want the doc marked as changed


  • Subject: Re: Making an initial change to document, and don't want the doc marked as changed
  • From: Felix Franz <email@hidden>
  • Date: Thu, 30 Aug 2007 16:20:41 +0200

On Aug 30, 2007, at 4:04 PM, Graham Perks wrote:

I have some initial document setup that needs doing to a new document... imagine starting a Pages document from a template, for example. I don't want all the template instantiation to be undoable, or to mark the document as needing saving.

How do I do this? This is a Core Data-based application. I've looked for methods in NSManagedObjectContext and NSPersistentDocument. NSDocument has updateChangeCount, but it reads like I should not call it directly.

This is described in the "Core Data Programming Guide: Using Managed Objects, Undo Management" <http://developer.apple.com/documentation/ Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html#//apple_ref/doc/ uid/TP40001803-207821-TPXREF148>


Example from the documentation:

NSManagedObjectContext *moc = ...;
[moc processPendingChanges]; // flush operations for which you want undos
[[moc undoManager] disableUndoRegistration];


// make changes for which undo operations are not to be recorded

[moc processPendingChanges]; // flush operations for which you do not want undos
[[moc undoManager] enableUndoRegistration];


Cheers,

felix

_______________________________________________

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: Making an initial change to document, and don't want the doc marked as changed
      • From: Graham Perks <email@hidden>
References: 
 >Making an initial change to document, and don't want the doc marked as changed (From: Graham Perks <email@hidden>)

  • Prev by Date: Making an initial change to document, and don't want the doc marked as changed
  • Next by Date: Re: Color matching of NSBitmapImageRep
  • Previous by thread: Making an initial change to document, and don't want the doc marked as changed
  • Next by thread: Re: Making an initial change to document, and don't want the doc marked as changed
  • Index(es):
    • Date
    • Thread