title: Comparing Dictionaries with Objects Value of Array in IOS
body: <p>I am having N number of Dictionaries &amp; having array that contains objects.
  I need to iterate and check whether value for key EmployeeID of dictionary exists at Object. say obj.empId or not in array.</p>
  
  <p>Dictionary looks like below</p>
  
  <pre><code>{
  "Message":[
  {
          "EmpID": 3749,
          "Dept": 10,
          "EmployeeName": "John",
  },
  {
  },
  {
  }]
  }  //so many dictionaries..not one
  </code></pre>
  
  <p>Example: I already have an array with 10 records say obj.empID holds from 1-10. From service I am getting 10 records say 10 dictionaries. In that key EmpID holds values 5-15. </p>
  
  <p>So, How can I iterate the loop so that to identify that new records are retrieved with different EmpID's then existing Records.</p>
  
  <p>Here is the Code I have done so far..</p>
  
  <pre><code>NSArray *responseArray=responseDict[@"Message"];
  
  for (NSDictionary *dict in responseDict[@"Message"]) {
      for (id key in responseDict) {
           if ([key isEqualToString:@"EmpID"]) {
                for (Employees *empObj in emparray)
                    {
                       BOOL isExists=YES;;
  
                      if (![empObj.empid isEqualToString:[responseDict objectForKey:key]]) {
                         isExists=NO;
                         break;
  
                         //here I need to do the logic..
                      }
                    }
               }
         }
   }
  </code></pre>
  
  <p>But it will not get accurate results or logic is nor correct..</p>
  
  <p>Please suggest any better solutions for above task or where I am going wrong..</p>
  
  <p>Any Ideas or suggestions are appreciated..</p>
  
  <p>Thanks..,</p>