Question: The "Stopping" statement never gets printed even if you type 'stop' when running the program. Is the `initWithUTF8String:` method introducing extra formatting?

```
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    char holderText[256];

    fgets(holderText, 256, stdin);
    NSString *words = [[NSString alloc] initWithUTF8String:holderText];

    if ([words isEqualToString:@"stop"]) {

        NSLog(@"STOPPING");

    }
    NSLog(@"This is what you typed: %@", words);

    [pool drain];
    return 0;
}

```

Answer: 
`fgets` will include the trailing newline in the string it gives you (except in the case where it wouldn't fit in the buffer but that's not so here), so it will be `"stop\n"` rather than `"stop"`.

Changing the log line to:

```
NSLog(@"This is what you typed: [%@]", words);

```

should hopefully make it clear what's happening.

Either modify the comparison to take this into account, or trim the newline off before comparing.
Since `fgets` will probably include a trailing newline, you might want to do a trim of all newlines in the string by using `stringByTrimmingCharactersInSet:`:

```
NSString *trimmed = [words stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];

if([trimmed isEqualToString:@"stop"]]) {
  //...
}

```