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

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!

    23 Oct

    fs_usage

    Tuesday October 23rd 2007, 10:49 pm
    Tags: , , , , ,

    Für alle ungeduldigen und besonders hypochondrisch veranlagten Mac-Benutzer sei das Folgende ans Herz gelegt: sudo fs_usage -f filesys (Tipp von hier). Wenn es mal wieder länger dauert und der Regenbogencursor auf die Nerven geht… Damit ist der Übeltäter schnell ausgemacht, und den Nerven gehts wieder besser.

    0 Comments

    01 Sep

    Pingus for Intel Macs

    Saturday September 01st 2007, 11:57 pm
    Tags: , , , ,

    The newest Pingus (a free Lemmings clone) version 0.7 uses SDL and hence it’s much more portable. E.g. SDL runs on Mac OS X which allows to “port” Pingus in nearly no time (an evening) to OSX, mainly by making it compile without name conflicts with Core Foundation. A few days ago at Games4Mac a PowerPC version was posted. I fixed the issues with Intel and here is the same for Intel Macs: http://www.savefile.com/files/1022074.

    pingus.jpg

    There are some issues with the music. It is not completely clear. Maybe a problem with the SDL port for Mac, no idea….

    1 Comment

    24 Jul

    As usual please

    Tuesday July 24th 2007, 2:18 pm
    Tags: , , ,

    Another hot candidate for the how-can-I-live-without tools, god sent for people using a mobile Mac with second monitor in the office: Forget-me-not:

    diagram-enabled.png 

     

     It puts your application where they belong after plugging in the secondary monitor. Why should you put Skype, Adium or whatever you prefer onto the second screen if this nice tool can do it for you.

    0 Comments

    16 Jul

    KBounce/Mac running - but needs a diet

    Monday July 16th 2007, 9:33 pm
    Tags: , , , , ,

    Not many words needed:

    kbouncemac.png 

    Just the following command lets one think:

    sts@goedel:/opt$ du -s -h
    3.5G

    I used the packages from KDE/Mac, more precisely qt4, kdesupport, kdelibs, strigi, kdegames.

    0 Comments