How to revert to an unedited document & window?
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