• 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: CoreData: How to create two separate in-memory stores?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: How to create two separate in-memory stores?


  • Subject: Re: CoreData: How to create two separate in-memory stores?
  • From: SA Dev <email@hidden>
  • Date: Wed, 27 Jul 2005 12:21:09 -0400

Frank:

It all depends on what you mean by "... try to add a second store with the same call ...". That's a pretty big question. Actual code, please? :-)





On Jul 27, 2005, at 11:57 AM, Frank Illenberger wrote:

Hi,

does anybody know if it is possible to use two separate in memory stores with one persistent store coordinator?

I use the following code to create an in-memory store:

NSPersistentStoreCoordinator *psc = [moc persistentStoreCoordinator];
id store = [psc addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil];


This works fine. But if I try to add a second store with the same call, I get the following exception: "Can't add the same store twice"

So I thought, the two stores needed separate urls identifying them. But when I start putting names into the URL like in the following line


id store = [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:[NSURL URLWithString:@"storeA"] options:nil error:nil];



I get the following error: "Can't find table for entity Person in database at URL storeA"


So how do I create two separate in-memory stores in one PSC?


Cheers


Frank


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: CoreData: How to create two separate in-memory stores?
      • From: Frank Illenberger <email@hidden>
References: 
 >CoreData: How to create two separate in-memory stores? (From: Frank Illenberger <email@hidden>)

  • Prev by Date: Re: NSScanner instert space every 2 characters
  • Next by Date: Re: CoreData: How to create two separate in-memory stores?
  • Previous by thread: CoreData: How to create two separate in-memory stores?
  • Next by thread: Re: CoreData: How to create two separate in-memory stores?
  • Index(es):
    • Date
    • Thread