I want to use a NSRuleEditor in my application, but I can't make it work... 
I've added an NSRuleEditor in Interface Builder and I've set its type to list and I've connected its datasource to my class. In that class I've implemented three delegate calls:
I just want a list of rules with two popups in each row. Each popup should have 3 options. I thought I should return 2 in the first delegate call to have two popups in each row, however that didn't work. Can anyone help me solving this problem?
Thanks!
I've added an NSRuleEditor in Interface Builder and I've set its type to list and I've connected its datasource to my class. In that class I've implemented three delegate calls:
Code:
- (NSInteger)ruleEditor:(NSRuleEditor *)editor numberOfChildrenForCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType {
NSLog([NSString stringWithFormat:@"Criterion: %@, %@", criterion, rowType]);
if (criterion == nil) {
return 3;
} else {
return 0;
}
}
- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType {
NSString *myString = [NSString stringWithFormat:@"Item %d", index];
return myString;
}
- (id)ruleEditor:(NSRuleEditor *)editor displayValueForCriterion:(id)criterion inRow:(NSInteger)row {
return criterion;
}
I just want a list of rules with two popups in each row. Each popup should have 3 options. I thought I should return 2 in the first delegate call to have two popups in each row, however that didn't work. Can anyone help me solving this problem?
Thanks!