• 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: loadNibNamed:owner: Who disposes of the loaded objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loadNibNamed:owner: Who disposes of the loaded objects?


  • Subject: Re: loadNibNamed:owner: Who disposes of the loaded objects?
  • From: Matthew Formica <email@hidden>
  • Date: Wed, 24 Sep 2003 16:52:29 -0700

From

<http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources
/Concepts/NibFileLoaded.html>

"Releasing Nib File Objects

When you load a nib file, all its top level objects have a reference count
of one. When the objects are no longer needed, another object needs to
release them. That other object is usually the file9s owner.

Note that NSWindowController automatically releases its nib file9s objects
for you. Also, NSWindow has a isReleasedOnClose attribute, which
automatically releases the window for you when it9s closed."

Regards,

Matthew Formica
Apple DTS Engineer - Dev Tools, G5, and Cocoa
email@hidden

On 9/24/03 4:35 PM, "M. Uli Kusterer" <email@hidden> wrote:

> Hi,
>
> I'm using [NSBundle loadNibNamed: @"MyNibFile" owner: self]; in one
> of my classes' -init method. It works like a charm, but I just
> realized that I don't know how I'm supposed to dispose of the loaded
> objects.
>
> One of my NIBs contains an NSView with sub-views, another contains
> an NSPanel. I have outlets in my class that are set to the loaded
> objects. Do I have to release them? I know I need to when I'm dealing
> with alloc, new or copy, but what about "load"?
>
> And if I'm not responsible for releasing them, who is? Are they
> autoreleased? Then why does my code work? Apple's docs are
> suspiciously quiet about this. They only say the objects are loaded
> into my object's zone ...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: loadNibNamed:owner: Who disposes of the loaded objects?
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: loadNibNamed:owner: Who disposes of the loaded objects?
      • From: Eric Friedman <email@hidden>
References: 
 >loadNibNamed:owner: Who disposes of the loaded objects? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: NSDocument architecture question
  • Next by Date: Re: Transparent color over an image: how to prevent a hole?
  • Previous by thread: loadNibNamed:owner: Who disposes of the loaded objects?
  • Next by thread: Re: loadNibNamed:owner: Who disposes of the loaded objects?
  • Index(es):
    • Date
    • Thread