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

Re: How to revert to an unedited document & window?


  • Subject: Re: How to revert to an unedited document & window?
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 29 Jun 2010 09:23:03 -0700

On 2010 Jun 29, at 05:23, Brad Stone wrote:

> 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.

Reverting a Core Data document is tricky.  Apple's recommended methods are given here:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/NSPersistentDocumentTutorial/04_Department/department.html#//apple_ref/doc/uid/TP40002832-SW6

But you should also read these:

http://www.cocoabuilder.com/archive/cocoa/161579-bug-in-nspersistentdocument-tutorial.html#161579
http://www.cocoabuilder.com/archive/cocoa/174292-bug-nspersistentdocument-core-data-tutorial.html#174292
http://www.cocoabuilder.com/archive/cocoa/177523-bug-nspersistentdocument-core-data-tutorial.html#177523

Since "Revert" is not a major advertised feature of the app I was working on, after trying unsuccessfully to make it work for an hour or so,  I gave up and implemented Revert to simply close and re-open the document.  It's a little slow and ugly, but it works, and eliminates a branch of regression possibilities.

_______________________________________________

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: Brad Stone <email@hidden>
References: 
 >How to revert to an unedited document & window? (From: Brad Stone <email@hidden>)

  • Prev by Date: Re: iPhone simple 'cartoon' animation
  • Next by Date: Re: Tracking multiple NSURLConnections
  • Previous by thread: How to revert to an unedited document & window?
  • Next by thread: Re: How to revert to an unedited document & window?
  • Index(es):
    • Date
    • Thread