Re: Version Nib Loading?
Re: Version Nib Loading?
- Subject: Re: Version Nib Loading?
- From: "Jeff Alexander" <email@hidden>
- Date: Wed, 20 Jun 2007 11:09:42 -0500
- Thread-topic: Re: Version Nib Loading?
>>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?<<
How about the mechanism that already does that?:
Do the new Nib as a localized Nib (if you have an internationalized app, and you should :) and register it in one of those region/languages it is unlikely (really unlikely) to be distributed in. You don't actually have to translate it from English of course; but unless a user has that language in which you've registered it as anything like a default they wouldn't load it anyway.
(as for NDA issues on releasing a Leopard Nib before the Leopard OS release, I can't comment).
Geoffrey Alexander
-----Original Message-----
From:
cocoa-dev-bounces+jeff.alexander=email@hidden
[mailto:cocoa-dev-bounces+jeff.alexander=email@hidden.
com]On Behalf Of Stephane
Sent: Wednesday, June 20, 2007 9:45 AM
To: Cocoa-Dev List
Subject: Version nib loading?
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
_______________________________________________
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