Created
April 20, 2012 05:38
-
-
Save aya-eiya/2426344 to your computer and use it in GitHub Desktop.
WindowsでObjective-C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <stdio.h> | |
#import <objc/object.h> | |
@interface Hello : Object | |
-(void)sayHello; | |
@end | |
@implementation Hello | |
-(id) init { | |
self=[super init]; | |
return self; | |
} | |
-(void) sayHello{ | |
printf("Hello Objective-C\n"); | |
} | |
@end | |
int main(void){ | |
Hello *myHello = [[Hello alloc] init]; | |
[myHello sayHello]; | |
[myHello free]; | |
return 0; | |
} |
NSObjectなんかは使えないので、文法の確認とかのみで使いましょう。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cygwinで簡単にインストールできた。
SetUp.exeで、gcc-objcで検索。
gcc-objc
mingw-gcc-objc
を選択してインストールするだけ。