Heim > Fragen und Antworten > Hauptteil
ARC环境下,事例代码如下
id __strong obj0 = [[NSObject alloc] init];
id __weak obj = obj0;
NSLog(@"obj0 :%p --- %ld", obj0, CFGetRetainCount((__bridge CFTypeRef) obj0));
NSLog(@"obj :%p --- %ld", obj, CFGetRetainCount((__bridge CFTypeRef) obj));
打印结果如下
2015-11-29 22:19:14.753 Test[15256:150713] obj0 :0x7f9f92d15d00 --- 1
2015-11-29 22:19:14.753 Test[15256:150713] obj :0x7f9f92d15d00 --- 3
这个3是怎么来的呢?