• 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: nib leaking NSFormatters?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nib leaking NSFormatters?


  • Subject: Re: nib leaking NSFormatters?
  • From: Amul Goswamy <email@hidden>
  • Date: Tue, 6 Jan 2004 11:53:45 -0800

This behaves as designed. It is the file's owner's responsibility to
release top level objects in your nibs. Please refer to the following
documentation:

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 files owner.

Note that NSWindowController automatically releases its nib files
objects for you. Also, NSWindow has a isReleasedOnCloseattribute, which
automatically releases the window for you when its closed.

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

Amul Goswamy
Interface Builder
Apple


On Jan 5, 2004, at 9:34 PM, Adam Ohren wrote:

> This is my first post, so sorry for anything stupid (this didn't get
> anywhere on studentdev).
>
> I have a document-based app that has an NSTableView, whose
> NSTableColumns have anonymous NSNumberFormatters attached - by
> "anonymous" I mean they were created in IB by simply dropping the
> formatters from a palette onto the columns.
>
> All is well, until I run the app and create a few document windows and
> then close them. running the command line tool 'leaks' indicates there
> are multiple NSCFString objects leaked. these appear to be related to
> those formatters; if I manually send release messages to the
> formatters in myDocument's -dealloc method, the leaks go away.
>
> I thought that the document's window controller was responsible for
> releasing all the objects created by a nib. am I responsible for
> releasing NSFormatters created by dropping them from the palette like
> that?
>
> thanks a lot,
>
> Adam Ohren
> email@hidden
> _______________________________________________
> 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.
_______________________________________________
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: nib leaking NSFormatters?
      • From: Adam Ohren <email@hidden>
References: 
 >nib leaking NSFormatters? (From: Adam Ohren <email@hidden>)

  • Prev by Date: Re: TableColumn identifiers
  • Next by Date: compiler Settings
  • Previous by thread: nib leaking NSFormatters?
  • Next by thread: Re: nib leaking NSFormatters?
  • Index(es):
    • Date
    • Thread