Retaining non-document windows
Retaining non-document windows
- Subject: Retaining non-document windows
- From: Daryle Walker <email@hidden>
- Date: Wed, 04 Jan 2017 05:30:14 -0500
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 (email@hidden)
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:
This email sent to email@hidden