Am 02.10.2009 um 06:53 schrieb Matthias Arndt:

I introduced a new key in user defaults reflecting the "toolbar version". If the toolbar version stored in the user defaults doesn't match the toolbar version of the application I simply delete the old plist settings and the application will display the default set of the new toolbar. The code is placed in "applicationDidFinishLaunching" of the application controller:

        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSString *toolbarVersion = [defaults stringForKey:@"ToolbarVersion"];
        if (![toolbarVersion isEqual:@"2.0"])
        {
[defaults removeObjectForKey:@"NSToolbar Configuration 130D8E5D- C86E-47DD-9A4E-B367517DA148"];
                [defaults setObject:@"2.0" forKey:@"ToolbarVersion"];
        }

For me this approach seems to be rough and it'll break if someone switches back to the older version. Unfortunately I had no better idea, but I'm open to suggestions ... Too bad the IB doesn't allow to set toolbar IDs.

IB 3.2 allows to set a toolbar identifier, so all my code is obsolete ... Just checked it and it works :-)

Thanks for the heads-up, Kevin!

Matthias
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to