The NSDocument system makes sure the windows it creates are retained until 
closing. You can see this in default new-project code. If you run the default 
code for non-document apps, you see that there's no way to bring back the 
initial window if closed, and therefore has no chance to show proper retaining 
etiquette. 

I always had to guess how to retain a non-document window. I usually get it 
after a bunch of hacking, but I want more official advice. Like I can get from 
here.

I think there are three scenarios:
- a window with 0 or 1 instances like an app-global photo album 
- arbitrary number of independent windows with the same type, like a web 
browser 
- an auxiliary window supporting a normal one, changing its displayed data when 
the top normal window changes. It should be hidden when no normal windows are 
open.

Whatever retaining system is used needs to handle when a window closes. It 
either sets a single handle to NIL, removes the pointer from an array, or hides 
the window (still holding a retain).

Sent from my iPhone
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to