Re: Setting (not saving) NSPersistentDocument Metadata changes file Modification Date
Re: Setting (not saving) NSPersistentDocument Metadata changes file Modification Date
- Subject: Re: Setting (not saving) NSPersistentDocument Metadata changes file Modification Date
- From: Jerry Krinock <email@hidden>
- Date: Fri, 5 Nov 2010 09:23:19 -0700
On 2010 Nov 04, at 21:53, Adam Swift wrote:
> The NSPersistentStoreCoordinator class method works directly with the file at the specified URL and so writes the metadata to the the file immediately. To modify the metadata on the store without saving automatically you need to use the store instance's setMetadata: method. You can access the store by iterating through the PSCs list of persistentStores and matching on the URL you're looking for.
Thank you, Adam. This isn't what I found in my first test yesterday, but apparently I screwed something up since upon retesting I see that you are correct. So I closed my bug and instead submitted this document feedback on the Core Data Programming Guide:
---------------------------------
Near the bottom of this page it states that:
"Setting the metadata for a store does not change the information on disk until the store is actually saved."
However, the code (for Mac OS X 10.5) above it is:
[NSPersistentStore setMetadata:newMetadata
forPersistentStoreWithURL:storeURL
error:&error];
but this particular method *does* in fact change the information on the disk (and the file modification date) immediately.
The statement is correct if -[NSPersistentStore setMetadata:] is used, but this is misleading since this is not the method used in the code example.
_______________________________________________
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