• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing an NSToolbar Identifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing an NSToolbar Identifier


  • Subject: Re: Changing an NSToolbar Identifier
  • From: Matthias Arndt <email@hidden>
  • Date: Thu, 22 Oct 2009 16:54:21 +0200

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 (email@hidden)

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:
This email sent to email@hidden


References: 
 >Changing an NSToolbar Identifier (From: Matthias Arndt <email@hidden>)

  • Prev by Date: Re: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
  • Next by Date: Re: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
  • Previous by thread: Changing an NSToolbar Identifier
  • Next by thread: Re: Why is scrollbar enabled? - SOLVED
  • Index(es):
    • Date
    • Thread