• 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
Version nib loading?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Version nib loading?


  • Subject: Version nib loading?
  • From: Stephane <email@hidden>
  • Date: Wed, 20 Jun 2007 16:44:31 +0200

Could it be possible to add what I would call "version nib loading" to the Cocoa framework?

Problem:
--------

You have a Cocoa application whose UI relies on nib files.

The version of your application you're working on is designed to look fine on shipping Mac OS X release.

Meanwhile, Apple is working on a new version of its OS that introduces some new widgets, new look, the HIG of the day, etc.

If the version of your application is released before the new OS is released or if your version needs to work on older versions of Mac OS X, you will not be able to tweak its UI to look perfectly fine on the new Apple OS release. Of course, you could spend too much time to dynamically change the look of your UI with some code, categories, constant definitions, weak linking, etc.



But wouldn't it be better if it was possible to provide different nib versions in your application and have the Cocoa framework load the most appropriate one depending on the OS release.

Example:
--------

Let's say you need some small square buttons as the ones seen in the "Accounts" system preferences pane.

These buttons were introduced in Mac OS X 10.4 as a new Cocoa NSButton type. They are not available on Mac OS X 10.3. As of today, if you want to have the same look in 10.3 and 10.4, you have to use either a custom widget or use a standard NSButton with pictures. So far for resolution independency for instance...

Wouldn't it be nice it you could write one nib version using the picture trick and another nib version using the new NSButton type?

In the Info.plist (for the Main nib) or in the .nib file, you would have a value to state that the first nib should be used on 10.3 or later. The second nib would be said to be used for 10.4 or later. The Cocoa framework would figure out which version to load depending on the OS version currently running.

This way, you can use and adjust to the latest HIG of the day with no code in most cases and still keep your old code. You would be able to dump the old nib when you don't need to support 10.3 anymore.

It is mainly possible to achieve this by yourself right now for secondary nib (it requires code), but this would not deal with the Main Nib since it's loaded automatically by the Cocoa NSApplication runtime.

And yes, this would increase the size of an application bundle but only a bit if the application is not too badly designed from a nib perspective.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Version nib loading?
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Special Characters / Character Palette
  • Next by Date: Shockwave integration
  • Previous by thread: Re: Special Characters / Character Palette
  • Next by thread: Re: Version nib loading?
  • Index(es):
    • Date
    • Thread