我正在做一些簡單的retaincount測試,我得到的是-1。關於iOS中的保留數量?
例如,
NSString *s1 = [[NSString alloc] init];
NSLog(@"s1 Retain Count = %d",[s1 retainCount]);
NSString *s2 = [NSString string];
NSLog(@"s2 Retain Count = %d",[s2 retainCount]);
我想知道是否有無論如何讓內部retaincount?
http://whentouseretaincount.com – vikingosegundo 2015-04-05 09:59:26
另請參閱http://stackoverflow.com/questions/4636146/when-to-use-retaincount。 – 2015-04-05 10:18:56