Re: communicating between windows
Re: communicating between windows
- Subject: Re: communicating between windows
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 8 Oct 2004 23:38:16 +0200
On vendredi, octobre 8, 2004, at 09:46 PM, John Spicer wrote:
How do you send data between windows? (Java). If one window opens
another, and you want the 2nd to return some data on closing to the
first, how do you do that?
I can't use a sheet for this, it has to be a window all by itself.
What I have is a controller, which creates another controller, that
then has a window in it. When the user picks something from this
second window, I want to close the 2nd window and return the picked
item to the first window.
Any ideas? Some docs I've missed?
2 solutions:
i)
1. When you create the other controller, add a reference to its creator
to it.
2.To be informed when a window is going to get closed, set your
controller to be the delegate of the window.
3. In your windowWillClose implementation, just call a method of the
main controller.
ii)
1. When you create the other controller, set your primary controller as
an observer of a specific notification name when the object is the
other controller
2. When you receive the windowWillClose notification, post a
notification with your data.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden