Re: nib leaking NSFormatters?
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.