123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #import "NSPredicate+XLFormAdditions.h"
- #import "NSExpression+XLFormAdditions.h"
- @implementation NSPredicate (XLFormAdditions)
- -(NSMutableArray*) getPredicateVars{
- NSMutableArray* ret = [[NSMutableArray alloc] init];
- if ([self isKindOfClass:([NSCompoundPredicate class])]) {
- for (id object in ((NSCompoundPredicate*) self).subpredicates ) {
- [ret addObjectsFromArray:[object getPredicateVars]];
- }
- }
- else if ([self isKindOfClass:([NSComparisonPredicate class])]){
- [ret addObjectsFromArray:[((NSComparisonPredicate*) self).leftExpression getExpressionVars]];
- [ret addObjectsFromArray:[((NSComparisonPredicate*) self).rightExpression getExpressionVars]];
- }
- return ret;
- }
- @end
|