{{works with|clang-602.0.53}} The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function: #import int main() { @autoreleasepool { NSLog(@"Hello, World!"); } } However the purpose of the NSLog() function is to print a message to standard error prefixed with a timestamp, which does not meet the most common criteria of a "Hello, World!" program of displaying only the requested message to standard output. The following code prints the message to standard output without a timestamp using exclusively Objective-C messages: #import int main() { @autoreleasepool { NSFileHandle *standardOutput = [NSFileHandle fileHandleWithStandardOutput]; NSString *message = @"Hello, World!\n"; [standardOutput writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; } } Objective-C also supports functions contained within the C standard library. However, Objective-C's NSString objects must be converted into a UTF-8 string in order to be supported by the C language's I/O functions. #import int main() { @autoreleasepool { NSString *message = @"Hello, World!\n"; printf("%s", message.UTF8String); } }