Custom binding not being updated
Custom binding not being updated
- Subject: Custom binding not being updated
- From: "Mike R. Manzano" <email@hidden>
- Date: Tue, 20 Nov 2007 00:20:11 -0800
Hello,
I have a class that exposes a custom binding, one which I'm trying to
bind to an NSArrayController. I know the NSArrayController is hooked
up correctly because several NSTableColumns are bound to it and are
updating appropriately. The NSArrayController manages Core Data
entities.
Here's the relevant code:
NSString *SERVICE_URL_BINDING_NAME = @"serviceURL" ;
…
+ (void) initialize
{
NSLog( @"Initializing %@" , self ) ;
[self exposeBinding:SERVICE_URL_BINDING_NAME] ;
}
- (void) awakeFromNib
{
[self bind:SERVICE_URL_BINDING_NAME
toObject:_blogAccountsController // the NSArrayController in
question
withKeyPath:@"arrangedObjects.serviceURL"
options:nil ] ;
}
// The KVC-compliant accessors
- (void) setServiceURL: (NSObject *) serviceURL
{
NSLog( @"Setting serviceURL to: %@, value %@" , [serviceURL class] ,
serviceURL ) ;
_serviceURL = serviceURL ;
}
- (NSObject *) serviceURL
{
NSLog( @"serviceURL called" ) ;
return _serviceURL ;
}
The problem is that setServiceURL: only gets called once some time
during application startup, and it is set to an empty array
(NSCFArray, value ()). If I add or remove items using the table view
(which should change the Core Data model), my accessors aren't called.
Shouldn't they be?
What am I missing?
Thanks in advance,
Mike_______________________________________________
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