07 May

Expecting too much from CoreData automatic model migration

Wednesday May 07th 2008, 3:51 pm
Tags: , , , ,

If you use Core Data in your Cocoa application, you will have discovered Xcode 3’s mapping model to go from one model version to another. This works very nicely on your local development Mac, but not so when deploying the code to others who do not upgrade to a new version 100 times a day.

The problem is that the automatic migration of the persistent store coordinator using the NSMigratePersistentStoresAutomaticallyOption option is not as clever as expected: it only migrates using exact matches of mapping models. It does not use multiple mappings to go from very old data models to the current one. This will bite you eventually.

Reading the documentation:

NSMigratePersistentStoresAutomaticallyOption
Key to automatically attempt to migrate versioned stores.

The corresponding value is an NSNumber object. If the boolValue of the number is YES and if the version hash information for the added store is determined to be incompatible with the model for the coordinator, Core Data will attempt to locate the source and mapping models in the application bundles, and perform a migration.

one can easily get the impression that it does this by talking about “mapping models”.

Also after some googling I did not find any hint about this, neither a solution.

The naive solution though works fine by just manually doing several migration steps until the current data model is reached. This is quite a lot of code, making me wonder I misunderstand anything here? This must be a problem everybody encounters eventually in Core Data apps.

0 Comments

27 Mar

Warum

Thursday March 27th 2008, 9:10 pm
Tags: , , ,

… werden für Richtungsangaben in der Ubahn nicht “U7 Nord” bzw. “U7 Süd” verwendet. Das würde dem Ortsunkundigen das Nachschlagen ersparen, wo denn nochmal Rudow im Berliner Umland liegt und wie sich das auf die richtige Wahl der Ubahnrichtung in der Berliner Innenstadt auswirkt.

0 Comments

27 Mar

Immer jüngere Mitarbeiter gesucht

Thursday March 27th 2008, 12:43 pm
Tags: , , , ,

monster.png

Da kann ich mit meinem Alter wohl nicht mithalten, bei Monster.de.

0 Comments

11 Mar

Key Account Manager

Tuesday March 11th 2008, 5:52 pm
Tags: , ,

bild-4.png

Was es nicht alles gibt: früher Verkäufer. Heute Key Account Manager.

1 Comment

24 Jan

S(cumm)60

Thursday January 24th 2008, 4:39 pm
Tags: , ,

monkey.jpg
320×200, passend fürs Handy :D

1 Comment

15 Dec

Rückkehr der Alt-Gr-Taste mit DoubleCommand

Saturday December 15th 2007, 3:25 pm
Tags: , , ,

Vor einiger Zeit hab ich einen Weg zur Alt-Gr-Taste auf dem Mac gepostet: Die Rückkehr der Alt-Gr-Taste. Da nicht jeder mit dem Terminal auf Du-und-Du ist, ist hier nochmal ein alternativer Weg mittels DoubleCommand, in einer leicht modifizierten Version, die die rechte Apfel-Taste in eine Alt-Gr-Taste (genauer in Alt, was aber mit dem Tastaturlayout unten wie Alt-Gr wirkt) umwandeln kann:

doublecommand.png

Download des modifizierten DoubleCommand: doublecommand-166b11.dmg

Der Rest ist wie bisher:

  • Das geänderte “Keyboard Layout” DeutschMitAltGr.keylayout kopiert man nach ~/Library/Keyboard Layouts (Eigene Änderungen lassen sich mit Ukelele vornehmen)
  • Jetzt meldet man sich ab und wieder an (damit OSX das neue Layout bemerkt) und setzt in den Landeseinstellungen/Tastaturmenü das Layout auf “Deutsch mit Alt-gr”.
    • Fertig! Die üblichen Tasten wie Alt-Gr+ß für den Backslash etc. sollten wieder funktionieren. Willkommen zu Hause!