Re: NSPredicate or Collection operators?

2015-07-16 Thread Sandor Szatmari
Martin, That's a nice approach. I had, maybe mistakenly, assumed that the objects in the dictionary were themselves dictionaries in which case I wouldn't mind embedding key names in predicate strings. The key names can be parametrized too, to mitigate some maintenance concerns. I do agree th

Re: NSPredicate or Collection operators?

2015-07-16 Thread Martin Wierschin
>> BOOL itemIsPresentWithIdenticalValue = [[[self.geofenceObjects allValues] >> filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"smi == %@", >> thingWeAreCheckingFor]] count] > 0; ... > I'm not a fan of mashing everything together into one line as it makes > readability and compreh

Re: NSPredicate or Collection operators?

2015-07-13 Thread Alex Zavatone
On Jul 13, 2015, at 1:27 PM, Sandor Szatmari wrote: > Why not write it like so... > > Sandor Szatmari > >> On Jul 13, 2015, at 10:52, Alex Zavatone wrote: >> >> Ahh, well, it turns out that I had the code right in the first place. >> >> Here it is if anyone needs to do the same thing. >> >>

Re: NSPredicate or Collection operators?

2015-07-13 Thread Sandor Szatmari
Why not write it like so... Sandor Szatmari > On Jul 13, 2015, at 10:52, Alex Zavatone wrote: > > Ahh, well, it turns out that I had the code right in the first place. > > Here it is if anyone needs to do the same thing. > > BOOL isItemPresentWithIdenticalValue = NO; > >NSArray *allObj

Re: NSPredicate or Collection operators?

2015-07-13 Thread Alex Zavatone
Ahh, well, it turns out that I had the code right in the first place. Here it is if anyone needs to do the same thing. BOOL isItemPresentWithIdenticalValue = NO; NSArray *allObjects = [self.geofenceObjects allValues]; NSArray *allOccurrencesOfSourceValue = [allObjects valueForKey:

NSPredicate or Collection operators?

2015-07-13 Thread Alex Zavatone
Hi all. I've got a dictionary of objects that contain properties and need to check if one object has a certain value. I was thinking I could use collection operators and build an array where the value of an an object's property matches that I'm looking for. Then if the array contains that valu