[[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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to