Solution for Challenge 1 & 2

Challenge 1

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

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

@autoreleasepool {

  
  // Challenge 1 (NSString 16)
    
    
    NSString *listOfNames = @"huhuWARDdsfadfadsfsadfafsfsadfafr";
    NSString *capListOfNames = [listOfNames uppercaseString];
    
    NSString *name = @"WaRdd";
    NSString *capName = [name uppercaseString];
    
    
    
    NSRange match = [capListOfNames rangeOfString:capName];
    if (match.location == NSNotFound)
    {
        NSLog(@"No match faound!");
    }else{
        NSLog(@"Found!");
        NSLog(@"location : %d",(int)match.location);
        NSLog(@"length : %d",(int)match.length);
        NSLog(@"The portion is from %d to %d",(int)match.location,(int)match.location + (int)match.length);

    }

    
}
return 0;

}[/code]

Challenge 2

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

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

@autoreleasepool {
    
// Challenge 2  (NSString 16)
    
    NSLog(@"hey who is cool?");
    const char *name = readline(NULL);
    NSString *string = [NSString stringWithUTF8String:name];
    NSLog(@"yeah %@ is really dope!!",string);
    
}
return 0;

}[/code]

why you add [b] besides the “#import<readline/readline.h>”?, I had written a similar codes like yours,but it can’t work, the reason seems like I did’t add [b] beside the “deadline.h”, what’s the founction of the [b] and where can I find the detailed description??please answer me ,thank you!!

I had tried your method about the challenge 2, but it’s still can’t work even I had add [b] besides the <readline.h>.