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-2912d15d00 --- 1
這個3是怎麼來的呢? 🎜
欢迎选择我的课程,让我们一起见证您的进步~~