Re: Bind to single table selection but not multiple?
Re: Bind to single table selection but not multiple?
- Subject: Re: Bind to single table selection but not multiple?
- From: Trygve Inda <email@hidden>
- Date: Mon, 11 Sep 2006 15:43:12 +0000
- Thread-topic: Bind to single table selection but not multiple?
> This thread should help (ignore my post which was kindly corrected):
> http://www.cocoabuilder.com/archive/message/cocoa/2006/6/30/166668
>
> George
>
>
Thanks George,
So:
- (id)transformedValue:(id)value {
return (([value intValue] > 1) ? [NSNumber numberWithBool:NO] : value);
}
How do I tell IB about this method... Since there seems to be no way to
determine that this is coming from my table.
Can I somehow enter this line (or a variation of it) on the value transform
line in IB?
Or did you use:
@implementation MyNSArrayController
- (void) awakeFromNib {
[self addObserver:self forKeyPath:@"selectedObjects"
options:0 context:nil];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object change:(NSDictionary *)change
context:(void *)context {
[self setValue:
[NSNumber numberWithBool:
[[self selectedObjects] count] == 1]
forKey: @"selectionIsOne"];
}
@end
Thanks,
Trygve
_______________________________________________
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