int main (int argc, const char * argv[])
{
@autoreleasepool {
point *a=[point alloc];//生成
point *p=[point alloc];
a=[a init]; //初始化
p=[p init];
point *m=[[point alloc] initX:20 andY:30];//分配初始化写一起
//point *n=[point new];
[a setXpoint:1];
[a setYpoint:2];
// [p setXpoint:9 andYpoint:10];
int x=[p xpoint];
int y=[p ypoint];
int x1=[a xpoint];
int y1=[a ypoint];
int m1=[m xpoint];
int m2=[m ypoint];
NSLog(@"x=%d y=%d" ,x,y);
NSLog(@"x1=%d y1=%d" ,x1,y1);
//NSLog(@"a=%d",[a retainCount]);
NSLog(@"m1=%d m2=%d" ,m1,m2);
NSLog(@"%
@" ,m);
[a dealloc];
//NSLog(@"a=%d",[a retainCount]);
//[a release];
[p release];
[m release];
//NSLog(@"p=%d",[p retainCount]);
}
return 0;
}