Another approach

It is interesting to see the different approaches taken. I dug around in the documentation and came up with this. Not as fast but works.

[code]#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{

@autoreleasepool {
    
    
    
   // Read in Names file
    NSString *nameString = [NSString stringWithContentsOfFile:@"/usr/share/dict/propernames"
                                                     encoding:NSUTF8StringEncoding
                                                        error:NULL];
    
    // Create array from string
    NSArray *names = [nameString componentsSeparatedByString:@"\n"];
    
    // Read in Words file
    NSString *wordString = [NSString stringWithContentsOfFile:@"/usr/share/dict/words"
                                                     encoding:NSUTF8StringEncoding
                                                        error:NULL];

    // create array
    NSArray *words = [wordString componentsSeparatedByString:@"\n"];
    
    // counter
    int foundCount = 0;
    

    NSArray *result = [[NSArray alloc] init];

    NSPredicate *test = [[NSPredicate alloc] init];
    
    for (NSString *name in names){
        
            test = [NSPredicate predicateWithFormat:@"SELF =%@",[name lowercaseString]];

            result = [words filteredArrayUsingPredicate:test];
        
            if ([result count] > 0) {
                foundCount++;
                NSLog(@"%@ : %@",name, result[0]);
            }
    }
    
    NSLog(@"There were %d found of the %ld names.",foundCount, [names count]);
    
}
return 0;[/code]