爲什麼我仍然在釋放我的對象後得到retainCount = 1
。爲什麼我釋放我的對象後仍然得到retainCount = 1
這是我的代碼。任何一個可以幫助我解決這個問題:
newsDetail *newsdetails = [[newsDetail alloc] initWithNibName:@"newsDetail" bundle:nil];
[newsdetails insertSomeData];
NSLog(@"Object Count in memmory = %d",[newsdetails retainCount]);
[self.view addSubview:newsdetails.view];
NSLog(@"Object Count in memmory = %d",[newsdetails retainCount]);
[newsdetails release];
NSLog(@"Object Count in memmory = %d",[newsdetails retainCount]);
........
2011-09-20 10:26:10.208 memmory[1977:207] Object Count in memmory = 1
2011-09-20 10:26:10.212 memmory[1977:207] Object Count in memmory = 1
2011-09-20 10:26:10.213 memmory[1977:207] Object Count in memmory = 1
retainCount無用。別叫它。 retainCount永遠不會返回0. – bbum