If you are writing a 10.5+ only application, you should be able to use NSString's stringByReplacingOccurrencesOfString:withString:
method to do this with fairly minimal code, by checking the length before and after removing the string you're searching for.
Example below (untested as I'm working on 10.4, but can't see why it wouldn't work.) I wouldn't make your application 10.5+ only just to use this though, plenty of other methods suggested by Macmade and in the duplicate question.
NSString* stringToSearch = @"ok no ok no no no ok";
NSString* stringToFind = @"no";
int lengthBefore, lengthAfter, count;
lengthBefore = [stringToSearch length];
lengthAfter = [[stringToSearch stringByReplacingOccurrencesOfString:stringToFind withString:@""] length];
count = (lengthBefore - lengthAfter) / [stringToFind length];
NSLog(@"Found the word %i times", count);