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: Adam Swift <email@hidden>
- Date: Sun, 7 Nov 2010 21:50:26 -0800
On Nov 6, 2010, at 1:40 PM, Sean McBride wrote:
> On Thu, 4 Nov 2010 21:53:28 -0700, Adam Swift said:
>
>> The NSPersistentStoreCoordinator class method works directly with the
>> file at the specified URL and so writes the metadata to the the file
>> immediately.
>
> I guess you're referring to PSC's:
>
> +setMetadata:forPersistentStoreOfType:URL:error: ?
>
> Is that the only one that writes to disk immediately?
No, calling +setMetadata:forPersistentStoreWithURL:error: on the NSPersistentStore subclasses also writes 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.
>
> What about PSC's:
>
> +setMetadata:forPersistentStore:
>
> Is the "Setting the metadata for a store does not change the information
> on disk until the store is actually saved" comment in the docs correct
> for this method?
>
Yes, the docs are correct (I'm assuming you meant the -setMetadata:forPersistentStore: instance method)
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng email@hidden
> Rogue Research www.rogue-research.com
> Mac Software Developer Montréal, Québec, Canada
>
>
_______________________________________________
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