Re: right way to load initial data in controls when opening a window
Re: right way to load initial data in controls when opening a window
- Subject: Re: right way to load initial data in controls when opening a window
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 04 Apr 2003 06:25:12 -0500
on 03-04-03 7:30 PM, Steve Woodward at email@hidden wrote:
>
The core of the problem for me is that I don't have a complete handle
>
on inter-class communications. I know about sending messages and about
>
accessor methods...but in this case I am confused because I am creating
>
a window controller from another "parent" window controller and I'm not
>
sure how the second window controller should reference data from the
>
first window controller.
In general, if controller B has a reference to controller A, you can call
any method in A from B using standard Objective-C message sending syntax.
In controller B, to send its data to controller A:
[[self controllerA] methodInA:datumInB];
This assumes you have written a public accessor method in B, named
controllerA, that returns the instance variable in B that you set up at
initialization with a reference to A.
It also assumes you have written a method in A, named methodInA:, which
takes its incoming parameter value and sticks it into some instance variable
in controller A.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.