-(NSUInteger) jacWordCount: (NSString *) string { __block NSUInteger wordCount = 0; [string enumerateSubstringsInRange:NSMakeRange(0, string.length) options:NSStringEnumerationByWords usingBlock:^(NSString *character, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { wordCount++; }]; return wordCount; }(Muchos thankos to Jared Crawford for a more modern implementation)