summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYannick Loriot <yannick.loriot@gmail.com>2013-08-13 14:56:09 +0200
committerYannick Loriot <yannick.loriot@gmail.com>2013-08-13 14:56:09 +0200
commit48fcef441fce2235e5dcd0d7c052b44f315504a5 (patch)
treefdea21e2f3367342dc3ff34ba1ee87ee54d894c1
parentd842eb4f819568c1503c26e494e271f1cd179542 (diff)
[ADD] Hello World!
-rw-r--r--objective-c.html.markdown21
1 files changed, 20 insertions, 1 deletions
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 <Foundation/Foundation.h>
+
+// 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