• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory management with nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Memory management with nibs (From: Julien Palmas <email@hidden>)
 >Re: Memory management with nibs (From: Dirk van Oosterbosch <email@hidden>)
 >Re: Memory management with nibs (From: Julien Palmas <email@hidden>)
 >Re: Memory management with nibs (From: Ondra Cada <email@hidden>)
 >Re: Memory management with nibs (From: Julien Palmas <email@hidden>)
 >Re: Memory management with nibs (From: j o a r <email@hidden>)

  • Prev by Date: Objective-C++ and overloading and inheritance of static member functions
  • Next by Date: Re: Printing issues
  • Previous by thread: Re: Memory management with nibs
  • Next by thread: Disable text field as label
  • Index(es):
    • Date
    • Thread