I am looking for some input on how to set the label for the left hand
expression / popup in an NSPredicateEditorRowTemplate.
I need to programmatically create a NSPredicateEditorRowTemplate so I
can populate the right side expression / drop down with dynamically
generated values.
In my subclass, I populate the values like so:
-------
-(id)initWithArray:(NSArray *)arr
{
NSString *keyPath = @"professions";
NSMutableArray *expressions = [NSMutableArray arrayWithCapacity:[arr
count]];
for(NSString *s in arr)
{
[expressions addObject:[NSExpression
expressionForConstantValue:s]];
}
if(!(self = [super initWithLeftExpressions:[NSArray
arrayWithObjects:[NSExpression expressionForKeyPath:keyPath], nil]
rightExpressions:expressions
modifier:NSDirectPredicateModifier
operators:[NSArray arrayWithObjects:
[NSNumber numberWithInt:NSContainsPredicateOperatorType],nil]
options:NSCaseInsensitivePredicateOption
]))
{
return nil;
}
//...
}
-------
I then add this to the NSPredicateEditor, and it works as expect.
However, the left column in the editor for this row shows
"professions" (the key value). I want it to show "Profession". If I
was using IB this would be very simple, as I could just rename it in
the popup.
How can I set the label for the left hand name in the editor?
Do I have to completely override all of the
NSPredicateEditorRowTemplate methods and manage all of the popups /
controls myself? I only need to change the label. Ive been trying to
figure this out off ad on for the past week, and havent come up with
any solutions other than override all APIs.
mike
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]