Non-document app's NSWindow keeps getting retained

David Dunham dunham at mac.com
Tue Feb 5 13:12:39 PST 2008


On 5 Feb 2008, at 11:05, David Dunham wrote:

> I've got a Cocoa app that manually creates an NSWindow (it's an  
> easier fit for a cross-platform engine). From my debugging, it  
> appears that every time I click another app's window, the retain  
> count on my NSWindow goes up by 2 (I have a windowDidResignKey  
> delegate which prints the retain count). I don't make an  
> NSWindowController.
>
> If I override -[NSApplication windows] and return an empty array,  
> the regain count doesn't keep climbing. This seems kind of odd.


I tried making the window in a .nib, and get the same results. The  
windows retainCount keeps increasing. (Only time it doesn't is when  
the window loses key due to clicking on the Dock.)

David Dunham
Voice/Fax: 206 783 7404             http://www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein



More information about the MacOSX-dev mailing list