tags:

views:

19

answers:

1

I did try – windowDidExpose: but it didn't work. What do I have to try for this?

My window is a utility window.

-- edit for more clarity --

What I want are:

viewWillAppear viewWillDisappear viewDidLoad viewDidUnload

in Cocoa Touch.

+1  A: 

There is windowDidClose:, but that probably only refers to closing; if you're sending your window an orderOut: message, I don't think that counts.

You probably need to either just track it from whatever code you're ordering the window in and out from, or subclass the window's class and override methods like makeKeyAndOrderFront: and orderOut: (whatever you're using, at least) to post custom notifications before calling up to super.

Peter Hosey
No delegate message for this? It's hard to believe! It seems not a good idea subclassing and overriding all of related methods because I can't sure which methods should be overridden for this...
Eonil
Hence the first suggestion: Track it from whatever code of yours tells the window to order in or out. The only way it could order out not by your hand would be the user closing it, and there's `windowDidClose:` for that.
Peter Hosey
OK, I understood. Thanks again!
Eonil