title: Objective-C: Count the number of times an object occurs in an array?
body: <p>I need to perform what I feel is a basic function but I can't find any documentation on how to do it. Please help!</p>
  
  <p>I need to count how many times a certain object occurs in an array. See example:</p>
  
  <pre><code>array = NSArray arrayWithObjects:@"Apple", @"Banana", @"Cantaloupe", @"Apple", @"DragonFruit", @"Eggplant", @"Apple", @"Apple", @"Guava",nil]retain];
  </code></pre>
  
  <p>How can I iterate through the array and count the number of times it finds the string @"Apple"?</p>
  
  <p>Any help is appreciated!</p>