Objective-C: Syntax
Objective-C syntax starter + common patterns.
Objective-C — Syntax
Hello World
#import <Foundation/Foundation.h>
int main(){ @autoreleasepool { NSLog(@"Hello, World!"); } return 0; }
Common patterns
Note: some languages differ. This page is a starter cheat sheet you can expand.
Comments
// line comment
/* block comment */
Variables (example)
// var / let / const / or language-specific syntax
Conditionals
// if / else
Loops
// for / while
Functions
// define a function