Re: Cocoa Bindings and multiple nibs
Re: Cocoa Bindings and multiple nibs
- Subject: Re: Cocoa Bindings and multiple nibs
- From: Anton Kiland <email@hidden>
- Date: Sun, 20 Mar 2005 20:27:44 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thanks a million, that solved it all!
Anton Kiland
email@hidden
2005-03-20 kl. 20.02 skrev Frédéric Testuz:
Le 20 mars 05, à 19:40, Anton Kiland a écrit :
In the NSDocument subclass (which is the delegate of the only window
belonging to it):
- (void)windowDidBecomeMain:(NSNotification*)notification
{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"MainWindowChange" object:self];
}
And in my controller:
- (void)awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mainWindowChange:)
name:@"MainWindowChange" object:nil];
}
- (void)mainWindowChange:(NSNotification*)notification
{
NSLog(@"Main window changed!");
current = [notification object];
}
And all those notification stuff works, it's the bindings I can't get
working correctly. Which is real odd (I'm not doing them code-wise).
Don't assign current directly, use accessor :
[self setCurrent:[notification object]];
Read one more time the documentation about KVC and KVO. I understand
that binding work by observing calling of accessor methods.
--
Frédéric Testuz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCPc6xX5qtjlHcF1YRAgx9AKCoZhpsFGY8WJ2ocBzS8gMYP/sV2ACgwQvS
e0bk/97J6FQj5OF8cshCl3s=
=XGSW
-----END PGP SIGNATURE-----
_______________________________________________
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