因为公司需要,开始看object-c,虽然还没ios系统,但现学下语法。
第一个例子不应该是helloWorld吗?但《Learn Objective-C on the Mac》书上不是。
#import <Foundation/Foundation.h>
int main (int argc, const char *crgv[])
{
NSLog(@"The number from 1 to 5");
int i;
for(i = 1; i <= 5:i++){
NSLog(@"%d\n",i);
}
return (0);
}
恩,没办法看结果,不过很简单。