• 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: Storing NSDocument data in packages/bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing NSDocument data in packages/bundles


  • Subject: Re: Storing NSDocument data in packages/bundles
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 31 Dec 2008 10:08:37 -0800

On Dec 31, 2008, at 1:32 AM, Kyle Sluder wrote:
On Wed, Dec 31, 2008 at 4:16 AM, Markus Spoettl
<email@hidden> wrote:
No I have not, but I have a feeling that it wouldn't be suitable. The data I
store contains (when the document is big) millions of double values (amongst
other things) spread across hundreds of thousands of objects. If the
performance of NSKeyedArchiver is any indication the system wouldn't scale
very well. It is an assumption and it might be totally wrong but I guess the
overhead of keyed archiving is significantly less than that of Core Data.

Quite the contrary, I'm afraid. Although without actually testing it, you can't know for sure.

OK, I wouldn't have expected that. The question is rather academic for me anyway as the application is existing and using non-Core Data objects already. Changing all the innards of the application is not an option at this point. Unless of course this is a lot less painfull than it sounds.


That's no problem, that information is available. The documentation for
-writeToURL:ofType:forSaveOperation:originalContentsURL:error: states:


----------
The value of absoluteURL is often not the same as [self fileURL]. Other
times it is not the same as the URL for the final save destination.
Likewise, absoluteOriginalContentsURL is often not the same value as [self
fileURL].
----------


which is a little problem because to update my packages I need to original
location. Do you have any insights as to what "often not the same" in this
context might mean? To write the diff into the package I'd have to have
access to the package. It doesn't sounds as it that's guaranteed.

For safe save operations, AppKit writes the data to a temporary file on the same volume, and then swaps the old file with the new, which is an atomic operation. If it can't do that, it will rename the original file and write the new one with the old name. This is why absoluteURL or absoluteOriginalContentsURL won't necessarily jive with -fileURL (see the comment header for -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] for more details). The upshot is that absoluteOriginalContentsURL will be a URL which you can use to access your existing on-disk data, whether or not AppKit has temporarily renamed it.


That would not help a lot because I'd have to copy the unchanged parts or the old package into the new package. The whole idea was not to re- write data that hasn't changed.

Thanks for the ideas though, I'll definitely investigate this further.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Storing NSDocument data in packages/bundles (From: Markus Spoettl <email@hidden>)
 >Re: Storing NSDocument data in packages/bundles (From: "Kyle Sluder" <email@hidden>)
 >Re: Storing NSDocument data in packages/bundles (From: Markus Spoettl <email@hidden>)
 >Re: Storing NSDocument data in packages/bundles (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: Making an object release itself?
  • Next by Date: Re: Reversing a String
  • Previous by thread: Re: Storing NSDocument data in packages/bundles
  • Next by thread: Re: Storing NSDocument data in packages/bundles
  • Index(es):
    • Date
    • Thread