title: How to filter nsdictionary?
body: <p>I want to search data from nsdictionary based on different criteria.Say I have 4 keys and user can search based on any number of keys ex:4,3 etc..Ex:I have dictionary containing keys(First Name,Last Name,Address,Phone Number).Now user can search based on any key say First Name and Last Name, or only First Name.I am using NSPredicate to search.My problem is how to create dynamic nspredicate?If I provide empty string in</p>
  
  <pre><code>[NSPredicate predicateWithFormat:@"FirstName  CONTAINS[cd] %@ AND LastNAme  CONTAINS[cd] %@ AND Address  CONTAINS[cd] %@ AND PhoneNumber  CONTAINS[cd] %@",firstname,lastname,addr,phone]
  </code></pre>
  
  <p>It does not give any result.How can I achieve this?or I have to create multiple nspredicate based on fields user has provide?</p>
  
  <p>Thanks in advance!</p>