XLForm icon indicating copy to clipboard operation
XLForm copied to clipboard

Predicates not functional

Open klattimer opened this issue 7 years ago • 3 comments

Sometimes I get a crash, sometimes it just doesn't do what it's meant to....

sample from my code.

NSString *const kXX = @"xx";

XLFormRowDescriptor *x = [XLFormRowDescriptor formRowDescriptorWithTag:kXX rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Test Predicate"];
x.value = @0;
[section addFormRow:x];

section = [XLFormSectionDescriptor formSection];
section.hidden = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"$%@ == 0", kXX]];
[form addFormSection:section];

klattimer avatar Dec 24 '17 18:12 klattimer

#998

klattimer avatar Dec 26 '17 19:12 klattimer

It seems that the dictionary supplied for hidden and disabled predicates isn't in the appropriate format, I've added an iteration to fix it (not ideal), a cache of the correct data would be a better option.

This fixes it, but not entirely, there also seems to be an issue with predicates not being evaluated in rows inside of sections which are governed by predicates. I'll fix that issue in a separate PR.

klattimer avatar Dec 26 '17 19:12 klattimer

The rows in sections thing wasn't a real issue.

klattimer avatar Jan 03 '18 15:01 klattimer