• 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
How to revert to an unedited document & window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to revert to an unedited document & window?


  • Subject: How to revert to an unedited document & window?
  • From: Brad Stone <email@hidden>
  • Date: Tue, 29 Jun 2010 08:23:54 -0400

I have a subclassed windowController that has an associated core data managedObject called "note", a managedObjectContext and a NSPersistendDocument.  Sometimes I need to reset everything back to the last time the doc was saved and make the doc clean (isDocumentEdited == NO) so that when I close it the documentController doesn't ask me if I want to save changes.

managedObjectContext rollback does restore everything to the last save but I can't get the document to be unEdited.  Using [window setDocumentEdited:NO] or [windowController setDocumentEdited:NO} (which I know I shouldn't call) both don't work.

Do I have to reset the persistendDocument somehow?

Using [NSPersistentDocument revertToContentsOfURL:(NSURL *)inAbsoluteURLofType:(NSString *)inTypeName error:(NSError**)outError] works except the window closes and opens.  If that didn't happen I'd be fine.

Thanks_______________________________________________

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: How to revert to an unedited document & window?
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Problems with UIButton still calling renamed method
  • Next by Date: Redirect NSLog to stdout?
  • Previous by thread: [MEET] CocoaHeads Mac Developer Meetings
  • Next by thread: Re: How to revert to an unedited document & window?
  • Index(es):
    • Date
    • Thread