• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Bindings and multiple nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Cocoa Bindings and multiple nibs (From: Anton Kiland <email@hidden>)
 >Re: Cocoa Bindings and multiple nibs (From: Jonathon Mah <email@hidden>)
 >Re: Cocoa Bindings and multiple nibs (From: Anton Kiland <email@hidden>)

  • Prev by Date: Re: Getting an image path from NSImageView
  • Next by Date: Re: Creating a large Cocoa project - tutorials?
  • Previous by thread: Re: Cocoa Bindings and multiple nibs
  • Next by thread: NSURL tunneling
  • Index(es):
    • Date
    • Thread