title: Counting occurrences of specific values in several NSDictionnary within Info.plist
body: <p>I have a .plist file that I use in my application for storing data, and I retrieve all the stuff in a dictionary.</p>
  
  <p>Here's what the plist looks like :</p>
  
  <pre><code>(
      {
      firstName = "18:43";
      imageFilePath = "exclamation.png";//     &lt;--- THIS is what I want to track.
      lastName = "25/02/2010";
      lieu = "Class 045";
      prof = "Mr. Maths";
      publicationYear = 12;
      title = "Mathematics";
  },
      {
      firstName = "16:43";
      imageFilePath = "accept.png";//          &lt;--- NOT this
      lastName = "01/01/2011";
      lieu = "Class 045";
      prof = "Mr. Maths";
      publicationYear = 12;
      title = "Mathematics";
  },
      {
      firstName = "16:43";
      imageFilePath = "exclamation.png";//     &lt;--- THIS
      lastName = "25/02/2011";
      lieu = "Class 045";
      prof = "Mr. Maths";
      publicationYear = 12;
      title = "Mathematics";
  }
  )
  </code></pre>
  
  <p><em>and so on...</em></p>
  
  <p>What I just want to do is to have an <em>int</em> (or <em>NSNumber</em>, or <em>NSInteger</em>, I don't really care) that is the value of how many occurrences of "<em>exclamation.png</em>" there are in my plist. (in the example above, that would be '2')
  (this number is then going to be the App's badgeNumber)</p>
  
  <p>I tried a lot of different things (including converting the plist to a string and searching, but that went badly) but I couldn't make any of them work...</p>
  
  <p>Thanks for your ideas !</p>
  
  <p>EDIT :</p>
  
  <p>This is how I load the plist :</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application {
  [_listController save];
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *documentsDirectory = [paths objectAtIndex:0];
  NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Books.plist"];
  
  // The code here....    
  
  }
  </code></pre>