I'm not even sure if this is possible, but if it is, it can help.
I have an NSArray of NSDictionarie s.
Each dictionary has certain keys (obviously).
Dict{ Title: WBCCount Cat: Lab } Dict{ Title: HbM Cat: Lab Sex: Male } Dict{ Title: HbF Cat: Lab Sex: Female } Dict{ Title: PC_Count Cat: CBC Sex: Female }
I would like to filter an array with dictionaries having Cat = 'Lab' and IF Sex , since the key is present in the dictionary object to get it with Male .
In short, I can not collect
predicateWithFormate:%@" Cat = Lab AND ( if Sex key is present, Sex = Male";
This will give me an array of WBC, HbM .
I donβt know if this is possible, a condition inside the predicate, but it would be a lifesaver if it were the way it happens with sending objects via the web API.
Any other way to achieve the goal, if not this, will also be great.
While we are in the Core Data topic, this should be simple: I want the attribute of an object to be able to store either NSDate , or NSNumber or NSString . Is there a simple way out?
jasonIM
source share