title: Best way to check several search combinations
body: <p>I made an app with different search combinations.</p>
  
  <p>The app has 6 textfields to put text in and search for. Every textfield is for another search criteria.</p>
  
  <p>There is only 1 textfield required to be filled in before you can search. Beside that, the user can choose how many textfields to fill in and search for. So there are multiple search combinations possible.</p>
  
  <p>The question is, what is the best way to determine what textfields are filled in and how to search objects that satisfies the search criteria.</p>
  
  <p>The search method should loop through an array of objects (in my case, an array of employee objects) and check if the values match.</p>
  
  <p>My goal is to limit the amount of if statements.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>HERE IS MY CODE UNTIL NOW:</p>
  
  <pre><code>-(IBAction)SearchEmployees:(id)sender{
  
  NSString *fullName = [(textfieldName.text)uppercaseString];
  NSString *functionName = [(textfieldFunction.text)uppercaseString];
  NSString *department = [(textfieldDepartment.text)uppercaseString];
  NSString *field = [(textfieldField.text)uppercaseString];
  NSString *expertise = [(textfieldExpertise.text)uppercaseString];
  NSString *interest = [(textfieldInterest.text)uppercaseString];
  
  NSMutableDictionary *filledTextfields = [NSMutableDictionary dictionary];
  
  if (![fullName isEqualToString:@""]){
      [filledTextfields setObject: fullName  forKey: @"fullName"];
  }
  
  if (![functionName isEqualToString:@""]){
      [filledTextfields setObject: functionName  forKey: @"functionName"];
  }
  
  if (![department isEqualToString:@""]){
      [filledTextfields setObject: department  forKey: @"department"];
  }
  
  if (![field isEqualToString:@""]){
      [filledTextfields setObject: field  forKey: @"field"];
  }
  
  if (![expertise isEqualToString:@""]){
      [filledTextfields setObject: expertise  forKey: @"expertise"];
  }
  
  if (![interest isEqualToString:@""]){
      [filledTextfields setObject: interest forKey: @"interest"];
  }
  
  
  NSMutableArray *foundEmployee = [[NSMutableArray alloc]init];
  
   for (id key in filledTextfields)
   {
       NSLog(@"KEY: %@ OBJECT: %@", key, [filledTextfields objectForKey:key]);
  
       for (Employee *employee in self.employees){    //self.employees is the array to search in
           //do something
       }
  
   }
  </code></pre>