если вы хотите подсчитать подстроки, вам придется искать подстроки, а затем каждый раз уменьшать диапазон ... что-то вроде.
-(NSInteger)occurrencesOfSubstring:(NSString *)substring inString:(NSString *)string
{
int occurrences =0;
NSRange searchRange = NSMakeRange(0, [string length]);
NSRange foundRange;
do {
foundRange = [string rangeOfString:substring options:NSCaseInsensitiveSearch range:searchRange];
if ((foundRange.location != NSNotFound)) {
occurrences++;
searchRange.location = foundRange.location+foundRange.length;
searchRange.length = [string length] - (foundRange.location+foundRange.length);
}
}while (foundRange.location != NSNotFound);
return occurrences;
}