Skip to content

Instantly share code, notes, and snippets.

@qnoid
Created November 12, 2013 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnoid/7432138 to your computer and use it in GitHub Desktop.
Save qnoid/7432138 to your computer and use it in GitHub Desktop.
To quickly try a snippet of code in objective-c using clang from the command line. 1. Create a "main.m" file (see example below) 2. Compile using "clang -o main main.m -lobjc -framework Foundation" 3. Run "./main"
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
NSArray *array = @[ @"a", @"b", @"c" ];
for (NSUInteger i = 0; i < array.count; i++)
{
NSLog(@"%@", array[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment