• 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
set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?


  • Subject: set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?
  • From: Mike Chambers <email@hidden>
  • Date: Wed, 13 Jan 2010 15:46:59 -0800

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@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

  • Follow-Ups:
    • Re: set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?
      • From: Peter Ammon <email@hidden>
  • Prev by Date: Re: Trying to create an alias file by using the new NSURL methods available with Mac OS X 10.6 !
  • Next by Date: Re: NSArrayControllers not repopulating after NSPersistentDocument load
  • Previous by thread: Re: Trying to create an alias file by using the new NSURL methods available with Mac OS X 10.6 !
  • Next by thread: Re: set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?
  • Index(es):
    • Date
    • Thread