RE: Guidelines for NIB usage
RE: Guidelines for NIB usage
- Subject: RE: Guidelines for NIB usage
- From: "Kevin Hoffman" <email@hidden>
- Date: Wed, 25 Jul 2007 14:24:55 -0400
- Thread-topic: Guidelines for NIB usage
The guideline that I have been following is this... if I have a bunch of
UI that is isolated from the rest of the app, but needs to interact with
each other, then I store that in a NIB file. I think it's all about
reuse. So, let's say I have a game that has a main window for playing,
and an editor window for modifying level content. This is clearly going
to be two NIBs, because for one the two clusters of UI don't often talk
to each other, if at all. Secondly, the editor window could easily be
pulled out of that NIB and re-used in a separate app that does nothing
but edit game content.
I just had no real idea of whether there were performance concerns or
technical limitations that also impacted the decisions as to when to use
a different NIB.
Speaking of re-use ... can a NIB file be part of a framework? So let's
say I'm building 5 applications and each one of them has a small chunk
that renders the same control and has the same controller class ...
could I re-use both the NIB and the .m/.h files by throwing them in a
framework?
-----Original Message-----
From: I. Savant [mailto:email@hidden]
Sent: Wednesday, July 25, 2007 2:21 PM
To: John Stiles
Cc: Kevin Hoffman; email@hidden
Subject: Re: Guidelines for NIB usage
On 7/25/07, John Stiles <email@hidden> wrote:
> For example, imagine your laptop user goes to visit some rarely-used
window
> five minutes after the app has started up-there will be a huge delay
while the
> hard drive spins back up so it can read 2K of NIB data off the disk.
An excellent argument. It comes back, then, to whether a first load
of a nib is cached like [NSImage imageNamed:@"foo"] ... if that's the
case, you still have a clear advantage when in the
many-instances-of-a-complicated-editor situation. Otherwise, perhaps
loading your very small preferences window from a separate nib *is* a
bit overboard ...
The prefs windows in my apps tend to be ... extensive. :-D I'm a
big fan of configurability and I separate things out into separate
panels, have a rather complicated controller (I use the
select-the-toolbar-item-and-do-an-animated-window-resize prettiness)
and icons / custom controls that don't show up anywhere else but in
prefs. This tends to cause a lot of work, so it's a good candidate to
leave behind at launch time.
Well, except for laptop users, anyway. :-)
--
I.S.
_______________________________________________
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