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 > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 04-29-2011, 02:27 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 22
Sebastian is on a distinguished road
Default Core Data - Mapping Model only for specific changes

Hi,
all my previous changes in my data model where migrated with the automatic lightweight migration.
For my persistentStoreCoordinator I set the following options:
Code:
  NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
                           [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
                           [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption,
                           nil];
Now I made a change that can't be automatically (lightweight) migrated.

I created a mapping model with a own subclass of NSEntityMigrationPolicy. The migration with the mapping model works.


My Problem is:
I only defined the mapping for the changes that can't be migrated with the lightweight method. Now all other entities/tables are empty.

Do I have to define all mappings in the mapping model (also AtoA, BtoB etc.)?
Is it possible to only define the mappings for specific changes and let all other changes automatically be migrated through the lightweight migration?


Edit:
I figured out that the option "NSInferMappingModelAutomaticallyOption" shouldn't be set to YES to migrate with the mapping model.
Do I need this option for the lightweight migration or is "NSMigratePersistentStoresAutomaticallyOption= YES" enough?
I'm afrai that the lightweight migration doesn't work, when I create a next datamodel-version and only want to use the lightweight method (without mapping model).

Last edited by Sebastian; 04-29-2011 at 03:47 AM.
Sebastian 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: 368
18 members and 350 guests
AyClass, baja_yu, checkright, dre, epaga, fvisticot, givensur, jPuzzle, Meoz, momolgtm, Newbie123, Objective Zero, Punkjumper, revg, sacha1996, skrew88, tomtom100
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,642
Threads: 94,110
Posts: 402,858
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pinacate
Powered by vBadvanced CMPS v3.1.0

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