Re: Memory management with nibs
Re: Memory management with nibs
- Subject: Re: Memory management with nibs
- From: Ondra Cada <email@hidden>
- Date: Fri, 22 Apr 2005 12:30:17 +0200
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@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden