NSPredicateEditorRowTemplate: Custom templateView state
NSPredicateEditorRowTemplate: Custom templateView state
- Subject: NSPredicateEditorRowTemplate: Custom templateView state
- From: Mario Fischer <email@hidden>
- Date: Tue, 3 Jun 2008 21:05:08 +0200
Hi -
- I use the NSPredicateEditor with a custom NSPredicateEditorRowTemplate
- This custom component should implement something like this:
[Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB]
By overriding templateViews I'm able to add an additional
NSPopupButton to the existing ones:
- (NSArray *)templateViews
{
NSArray* myviews = [super templateViews];
NSPopUpButton* myButton = [[NSPopUpButton alloc] init];
[myButton addItemsWithTitles:[NSArray arrayWithObjects:@"KB", @"MB",
@"GB", nil]];
return [NSArray arrayWithObjects: [myviews objectAtIndex:0],[myviews
objectAtIndex:1],[myviews objectAtIndex:2], myButton, nil];
}
But in predicateWithSubpredicates I can't find out, which of the
entries the user selected:
- (NSPredicate *)predicateWithSubpredicates:(NSArray *)subpredicates
{
[[[self templateViews] objectAtIndex:1] titleOfSelectedItem]; // works
[[[self templateViews] objectAtIndex:3] titleOfSelectedItem]; // is
always the first entry, regardless of the user selection..
...
}
What am I missing here / doing wrong?
Thanks in advance,
Mario
_______________________________________________
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