1. 没有包名,为了防止冲突,加前缀NS
NSString, NSArray,
2. 关键字前加@开头
3. 语法:
基本类型:char, int , float, double, bool(yes/no)
nil= java中的null
self=java中的this
基本语句:循环(do, while, while, for),条件(if,if-else, switch),goto
for循环:for(xx in xx);
基类:NSObject
继承-单继承,用super调用父类
异常:@try,@catch,@finally
注释:“//” "/****/"
日志输出:NSLog(@"hello"); NSLog(@"age is %i", 27);
NSLog 相当于printf
%i --- 输出整型数据
%f ---输出浮点型,%.2f 保留2位小数