title: Find the highest repeated character in string and the count of the repeated character
body: <p>I need to get the highest repeated character in string and the count of the repeated character.
  For that i stored the each character of the string in the array and using the for loops i got each character and the count. is there any other delegate methods to find it to reduce the code?</p>
  
  <p>for example</p>
  
  <pre><code>NSRange theRange = {0, 1}; //{location, length}
  NSMutableArray * array = [NSMutableArray array];
  for ( NSInteger i = 0; i &lt; [myFormattedString length]; i++) {
      theRange.location = i;
      [array addObject:[myFormattedString substringWithRange:theRange]];
  }
  int countForChar = 0;
  for (int i=0; i&lt;[array count]; i++) {
      NSString *firstCharacter = [array objectAtIndex:i];
      for (int j=1; j&lt; [array count]; j++) {
          if ([firstCharacter isEqualToString:[array objectAtIndex:j]]) {
              countForChar = countForChar + 1;
          }
      }
      NSLog(@"The Charcter is %@ The count is %d", firstCharacter, countForChar);
      countForChar = 0;
  }
  </code></pre>
  
  <p>Thanks in advance...</p>