From 48fcef441fce2235e5dcd0d7c052b44f315504a5 Mon Sep 17 00:00:00 2001 From: Yannick Loriot Date: Tue, 13 Aug 2013 14:56:09 +0200 Subject: [ADD] Hello World! --- objective-c.html.markdown | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 21460632..63aa64f1 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -18,7 +18,26 @@ It is a general-purpose, object-oriented programming language that adds Smalltal Multi-line comments look like this. */ -##Basic types +// Imports the Foundation headers with #import +#import + +// Your program's entry point is a function called +// main with an integer return type. +int main (int argc, const char * argv[]) +{ + // Create an autorelease pool to manage the memory into your program + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + // Print "Hello World!" to the console + NSLog(@"Hello World!"); + + // Clean up the memory you used into your program + [pool drain]; + + // End your program + return 0; +} + // all the primitive variable types are the same as in C // char, int, long, double, float -- cgit v1.2.3