Re: Multi Window cocoa application
Re: Multi Window cocoa application
- Subject: Re: Multi Window cocoa application
- From: Sebastian Morsch <email@hidden>
- Date: Sun, 04 Apr 2010 23:03:37 +0200
Hi Bharadwaj,
I can't point you to the resources/sample code, but maybe this helps
you anyway: when following the MVC paradigm, windows must NOT
communicate with each other directly. Instead, they are usually owned
by window controllers (subclasses of NSWindowController you will have
to write). These controllers may have methods and properties specific
to the functionality represented by their windows. The controllers
themselves are usually owned and managed by the Application Delegate
which coordinates their interaction. This interaction can be
implemented by various means (i. e. KVO or Notifications).
I think Apples "Cocoa Fundamentals Guide" goes into more detail
regarding this.
If you simply need a parameter that is set in one window for
functionality that is part of another window, you can bind that
parameter to NSUserDefaultsController and fetch it from there when you
need it. As a nice side-effect, that value is stored in the
preferences file of your app.
Hope that helps a little!
Best,
Sebastian
Am 04.04.2010 um 01:22 schrieb Bharadwaj Parthasarathy <email@hidden
>:
Hi,
I am currently working on porting an existing open source windows
application to mac OSX.
I am fairly new to cocoa programming.
The application involves opening a new window for a specifying the
parameters of the simulation.
The second window has about 20 textboxes and cannot be a modal window.
I have the XIB files and I got the windows working together somehow,
but needs a lot of fixing.
If there are multiple windows in an application, how do I pass
values and messages between them?
Apple developer library does not have an example source code and
many internet sources point to
/Developer/Examples/InterfaceBuilder/SimpleMultiWindow which is
apparently not present in leopard.
If some one has this example, that would be great. Also, this
example being removed hints that there is a new and better way to do
it?
I would appreciate if someone can pass on resources or sample code
on working with multiple windows in a cocoa application.
Just to clarify, this is not a document based application. You can
reach me at barbi dot bruce at gmail
Thanks,
B
_______________________________________________
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
_______________________________________________
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