本帖最后由 Mike001 于 2015-4-22 10:59 编辑
为什么在retain前后输出的计数值是一样的?
#import <Foundation/Foundation.h>
#import "Person.h"
int main(int argc, const char * argv[])
{
Person *p = [[Person alloc] init];
NSUInteger c = [p retainCount];
NSLog (@"The value of counter:%lu",c);
[p retain];
NSLog (@"The value of counter:%lu",c);
return 0;
}
|
|