Skip navigation.
 
mlRe: single vs multiple NIBs
FROM : Jamie Phelps
DATE : Thu Feb 14 17:02:21 2008

On Feb 14, 2008, at 9:13 AM, Torsten Curdt wrote:

> On 14.02.2008, at 16:06, Matt Gough wrote:

>> On 14 Feb 2008, at 15:57, Torsten Curdt wrote:

>>> I would like get some input on when to use a single NIB and when 
>>> to load up other NIBs manually.
>>>
>>> E.g. there is a PreferenceController example in Aaron's "Cocoa 
>>> Programming for Mac OSX" that does load the preferences NIB 
>>> manually when you click on the menu item. What makes me wonder is 
>>> - why not just include that window into the same MainMenu.nib?

>> Simple answer - Everything in the nib gets instantiated when the 
>> nib is loaded. If the user never chooses to show the preferences 
>> all that stuff to do with the preferences window would be wasting 
>> memory. Also, the less stuff you have in MainMenu.nib, the quicker 
>> your app will load.

>
> Alright that's what I assumed but thought there might have been 
> other reasons as well.


The other reason that Hillegass mentions in the text (I just went 
through this chapter myself.) is that if you split that functionality 
out into its own nib and corresponding controller class, you can more 
easily reuse the resources in other projects. See page 168, second 
full paragraph.

HTH,
Jamie

Related mailsAuthorDate
mlsingle vs multiple NIBs Torsten Curdt Feb 14, 15:57
mlRe: single vs multiple NIBs Jean-Daniel Dupas Feb 14, 16:03
mlRe: single vs multiple NIBs Matt Gough Feb 14, 16:06
mlRe: single vs multiple NIBs Torsten Curdt Feb 14, 16:13
mlRe: single vs multiple NIBs Andrew Merenbach Feb 14, 16:37
mlRe: single vs multiple NIBs Jamie Phelps Feb 14, 17:02