title: Reading plist file
body: <p>I created plist with big base of different animals in it (keys) and added this plist in my project.
  Type of every animal is NSDictionary. In every dictionary there are 5 more keys - characteristics of these animals (). I would like to go through every animal and if I match a certain  characteristics of this animal, I put this animal in another array.</p>
  
  <p>So, I tried to make a code:</p>
  
  <pre><code>NSArray *newArray = [[NSArray alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"animals" ofType:@"plist"]];    
  
  for (int i = 0;[newArray objectAtIndex:i];i++)    
  {      
        if ([[newArray objectAtIndex:i]objectForKey:@"minAge"] == [NSNumber numberWithInt:3]) 
        {            
                [array addObject:[[newArray objectAtIndex:i]objectForKey:@"name"]];                  
        }
  }
  </code></pre>
  
  <p>So <code>objectAtIndex:i</code> is an animal and <code>minAge</code> is one of it's characteristics. But my code does not work.
  I do it for the first time, so what I have done wrong ? Thanks!</p>
  
  <p>UPDATE:
  Thank you, your plist works normally ! But I still cant understand why doesn't work mine plist: 
  <img src="https://i.stack.imgur.com/yYTfb.png" alt="My plist was looking like this"></p>
  
  <p>Anyway, thank you so much ! I didn't eat and sleep while I was solving this problem :)
  You helped me a lot !</p>