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 19:40:00 +0100
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).
current is:
MyDocument *current;
and properties of my NSDocument subclass is:
NSMutableDictionary *properties;
Thanks in advance.
Anton Kiland
email@hidden
2005-03-20 kl. 15.07 skrev Jonathon Mah:
On 20 Mar 2005, at 23:54, Anton Kiland wrote:
To get away from a whole lot of code, I want to use cocoa bindings.
So I set up a NSObjectController pointing to my controller class in my MainMenu.nib.
Then in the inspector window in that nib, I bind one of the fields to the NSObjectController,
with the path current.properties.name. Where, as stated, current is the current NSDocument,
properties is an NSMutableDictionary in the NSDocument, and name is an added key to
that dictionary.
I have as of yet gotten to different results when trying to get this to work:
1) Nothing happens what so ever.
Can you post some code of what you're doing or something?
Jonathon Mah
email@hidden
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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