Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-23-2011, 06:48 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Location: Lyon, France
Posts: 7
josss is on a distinguished road
Default [Core Data] Problem when versioning with two models

Hi there,

I'm having some trouble with CoreData.
At the time I created my app, I chose to create two stores, based on two different models:
- Store_1 with Model_1
- Store_2 with Model_2

However, I didn't quite understand all the underlying concepts behind CoreDate, which made me make a mistake : when creating the corresponding
NSManagedObjectModels I did the following:
- ManagedObjectModel_1 = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
- ManagedObjectModel_2 = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];

I followed tutorials found on the internet, but it appears it was a bad idea, because Xcode merged the two bundle models in each managedObjectModel, hence creating two separate stores with the same model.

I understood that when I tried to upgrade Model_1 : in order to preserve user data, I decided to use versioning, which crashed because the new merged model was different from the one used to create the store.

Now, I'm totally unable to migrate Store_1 toward Model_1_v2 (No pb w/ Store_2 which I can delete and recreate with the correct model).

I tried to "manually" merge the two original models, and then managed to open Store_1, but now I can't create a mappingModel :-((

Any idea ?

it's a huge pain in the a.. considering I just want to tranform an integer 16 in integer 32 (which was a second mistake), and lightweight migration won't work.

Heeeeelp :-/
josss is offline   Reply With Quote
Old 11-25-2011, 01:13 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2009
Location: Lyon, France
Posts: 7
josss is on a distinguished road
Default

Anybody ?
josss is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 404
14 members and 390 guests
7twenty7, chiataytuday, Clouds, dedeys78, Duncan C, e2applets, EvilElf, iekei, ipodphone, leostc, Murphy, QuantumDoja, sacha1996, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:36 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0