• 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: Two questions about CoreData migration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two questions about CoreData migration


  • Subject: Re: Two questions about CoreData migration
  • From: Timothy Larkin <email@hidden>
  • Date: Sat, 23 Aug 2008 11:00:43 -0400

On Aug 22, 2008, at 12:14, Timothy Larkin wrote:

The first question is a simple one. After migration, the old persistent store is renamed sourceURL~.xml, and the document is supposed to open with a new persistent store with the old url, sourceURL.xml,. However, the document window that appears after migration has the title sourceURL~.xml, and saving this replaces the original, unmigrated document. Why doesn't the document open with sourceURL? I have examined the document at various stages during the open document process, and it consistently reports the URL without the tilde. And that is how the window initially appears. However, it switches to the form with the tilde as soon as the window is activated.


I went so far as to subclass NSDocumentController, overriding openDocumentWithContentsOfURL:absoluteURL display:error:. I tried many ideas, including closing the document and having NSRunLoop send a message to reopen the document after openDocument had returned. Even with this desperate approach, the document opened as sourceURL~.xml, which was very perplexing.


The resolution is quite strange. I had been setting a break point in the over-ride function, so that I could examine the state of the document after I called super openDocument. I discovered, quite by accident, that if I removed the breakpoint, the document opened as sourceURL, as expected. With the break point: sourceURL~.xml; without the break point: sourceURL.xml. This makes absolutely no sense to me, but it is certainly the case.

--
Timothy Larkin
Abstract Tools
Caroline, NY

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________

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: Two questions about CoreData migration
      • From: Quincey Morris <email@hidden>
References: 
 >Two questions about CoreData migration (From: Timothy Larkin <email@hidden>)
 >Re: Two questions about CoreData migration (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Incorrect instance of custom view loading after unarchiving
  • Next by Date: Re: Implementing isEqual: and hash
  • Previous by thread: Re: Two questions about CoreData migration
  • Next by thread: Re: Two questions about CoreData migration
  • Index(es):
    • Date
    • Thread