Re: Communications between multiple NIB's
Re: Communications between multiple NIB's
- Subject: Re: Communications between multiple NIB's
- From: Jonathan Hess <email@hidden>
- Date: Mon, 24 Mar 2008 12:37:13 -0700
Hey Lincoln -
To do this with actions and outlets, you just have to have your
controllers communicate.
Something like this should work:
@interface MainController : NSObject {
NSWindow *window;
}
- (void)setWindowBackgroundColor:(NSColor *)color;
@end
@implementation MainController
- (void)setWindowBackgroundColor:(NSColor *)color {
[window setBackgroundColor:color];
}
@end
@interface PrefController : NSObject {
NSColorWell *colorWell;
MainController *mainController;
}
- (IBAction)updateColor:(NSColorWell *)sender;
@end
@implementation PrefController
- (IBAction) updateColor:(NSColorWell *)sender {
[mainController setWindowBackgroundColor:[colorWell color]];
}
@end
I typed that directly into Mail, so it probably won't compile -
Jon Hess
On Mar 24, 2008, at 9:02 AM, Lincoln Green wrote:
Alright, I have been searching archives, following tutorials, and
looking at source code for several hours, and I cannot figure out
the answer to my problem.
Is there a way to programmatically connect to a NIB file and read
it's outlets without changing my File's Owner? I have a color well
in one NIB (My Prefs NIB) and a window in another. I want the color
well to change the window's background. I have an action called
setColor:, but I cannot figure out how to access the window outlet
from the NIB containing the window. Please help!
LG
_______________________________________________
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