Skip navigation.
 
mlRe: Memory management with nibs
FROM : Ondra Cada
DATE : Fri Apr 22 12:30:17 2005

J o a r,

On 22.4.2005, at 9:22, j o a r wrote:

> Perhaps Apple should add a NSNibController class, that you could use
> as the superclass of objects that loads a single nib file? The only
> functionality this class would need to provide is the automatic
> deallocation of top level nib objects, much as NSWindowController
> does. Would be kind of neat.


In my personal and highly subjective opinion, with the services of
NSNib already available, the class would be too simple to have a real
raison'd etre. Anyway, you can make one yourself in no time flat, if
need be.

A propos of loaded views: presumed they are loaded once, added to some
view hieararchy, and not switched in/out later, the following pattern
might be slightly more convenient:

...
IBOutlet MyView *loadedView;
...
[NSBundle loadNibNamed:"MyNIBWithView" owner:self];
[parentView addSubview:loadedView];
[loadedView release]; // retained by the parent view

without a need to take care anymore, for the view will be released when
the whole window gets dealloc'd.
---
Ondra Čada
OCSoftware:    <email_removed>              http://www.ocs.cz
private        <email_removed>            http://www.ocs.cz/oc

Related mailsAuthorDate
mlMemory management with nibs Julien Palmas Apr 21, 11:05
mlRe: Memory management with nibs Dirk van Oosterbos… Apr 21, 13:49
mlRe: Memory management with nibs Julien Palmas Apr 22, 02:26
mlRe: Memory management with nibs Ondra Cada Apr 22, 03:35
mlRe: Memory management with nibs Julien Palmas Apr 22, 08:44
mlRe: Memory management with nibs j o a r Apr 22, 09:22
mlRe: Memory management with nibs Ondra Cada Apr 22, 12:30