Re: Core Data: How to find the NSPersistentStore of a managed object
Re: Core Data: How to find the NSPersistentStore of a managed object
- Subject: Re: Core Data: How to find the NSPersistentStore of a managed object
- From: Mike Abdullah <email@hidden>
- Date: Sun, 13 Sep 2009 17:36:06 +0100
[[foo objectID] persistentStore];
Note that this only applies to saved objects which have been persisted
to a store (or maybe have had a persistent ID generated?). Sadly I
don't think there's any API for knowing which store an object will be
assigned to when saved, short of calling -assignObject:toStore:
yourself and recording the result.
Mike.
On 13 Sep 2009, at 12:24, Peter Ferrett wrote:
Hi, I have a model that comprises two stores. 1. A read only
store of a large data-set (this is read only as it is a public
dataset shared among users) and 2. A read-write store that is the
result of creation by user actions. One of my managed objects can
belong to either store. During program execution I need to find
the NSPersistentStore associated with the managed object. I thought
this would be fairly straight forward, but cannnot find any method
(s) in any of the Core Data docs on how to do this (I need to find
the store because I am getting save errors when transient properties
are changed on the read-only managed objects - one workaround is to
send a refreshObject:mergeChanges method in the willSave: method if
the object belongs to a read only store). Can anyone please point
me in the right direction on how to find the store associated with a
managed object.
Kind Thanks
Peter
_______________________________________________
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
_______________________________________________
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