SMutableArray* ary = [[NSMutableArray array] retain]; NSString *str = [NSString stringWithFormat:@"test"]; [str retain]; [ary addObject:str]; NSLog(@"%d", [str retainCount]); [str retain]; [str release]; [str release]; NSLog(@"%d", [str retainCount]); [ary removeAllObjects]; NSLog(@"%d", [str retainCount]);
|