title: How to check whether the dictionary exixts or not in Iphone?
body: <p>I have an Iphone application in which i am adding values to an array from a dictionary.can anybody tell me how i can check whether the dictionary exists or not before iterating in it?</p>
  
  <pre><code>NSDictionary *news=[dict objectForKey:@"news"];
  NSDictionary *deals=[dict objectForKey:@"deals"];
  NSLog(@"%@",[news classForCoder]);
  NSLog(@"%@",news);
  NSLog(@"%@",deals);
  
  for(NSDictionary *key in news)
  {
      if([key isKindOfClass:[NSDictionary class]])
      {        
          [dataArray addObject:key]; 
      }
      // NSLog(@"%@",rewardsId);
      //[dataArray addObject:dictrewards];
  }
  
  for(NSDictionary *key in deals)
  {      
      if([key isKindOfClass:[NSDictionary class]])
      {  
          [dataArray1 addObject:key];       
      }
  
      // NSLog(@"%@",rewardsId);
      //[dataArray addObject:dictrewards];
  }
  
  self.newsseperatearray=dataArray;
  self.dealsseperatearray=dataArray1;
  
  self.newssarray = [[dataArray arrayByAddingObjectsFromArray:dataArray1] mutableCopy];
  
  NSLog(@"%@",self.newssarray);
  //self.newssarray=dataArray;
  [self.mTableView reloadData];
  </code></pre>