2Dot grammar
http://www.cnblogs.com/mjios/archive/2013/04/08/3006577.html
.
#import <Foundation/Foundation.h> #import "Student.h" int main(int argc, const char * argv[]) { @autoreleasepool { Student *stu = [[Student alloc] init]; // 设置age的值 [stu setAge:10]; // 取出age的值 int age = [stu age]; NSLog(@"age is %i", age); [stu release]; } return 0; }
用点语法如何表示?