object-c释放内存的三种方式
1.
Person *p=[[Person alloc]init]; [p eat]; [Person name:@"wen" :@"male"]; [p release];
2.
Person *p=[[[Person alloc]init]autorelease]; [p eat]; [Person name:@"wen" :@"male"];
3.
@autoreleasepool { Person *p=[[Person alloc]init]; [p eat]; [Person name:@"wen" :@"male"]; // insert code here... NSLog(@"Hello, World!"); }