Objective-C Online Compiler

About the Objective-C compiler

The original iOS language. Compiled online. Run Objective-C code in your browser with no install and no signup — the editor, the input and the output share one screen. Objective-C is executed by a remote runtime: your code is submitted to it and the output is returned to this page.

Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.

A Objective-C example

This is the program the Objective-C editor opens with — run it as it is, then change it.

#import <Foundation/Foundation.h>
@interface Greeter : NSObject {
    NSString *_name;
}
@property (nonatomic, copy) NSString *name;
- (NSString *)greeting;
@end
@implementation Greeter
@synthesize name = _name;
- (NSString *)greeting {
    return [NSString stringWithFormat:@"Hello from %@!", _name];
}
@end
int main(void) {
    @autoreleasepool {
        Greeter *greeter = [[Greeter alloc] init];
        [greeter setName:@"Objective-C"];
        printf("%s\n", [[greeter greeting] UTF8String]);
    }
    return 0;
}

More Mobile compilers

Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.