是否有关于ARC的内存泄漏?
NSMutableArray *array = [[NSMutableArray alloc] init];
NSNumber *numberForTest = [[NSNumber alloc] initWithInt:123456];
[array addObject: numberForTest];
[numberForTest release];
NSLog(@"number = %@", numberForTest); //safe to access "numberForTest" after calling release???
[array release];
我担心的是:
[array addObject: numberForTest];
在之前,使“numberForTest”无法解除分配
[array release];
??? 使用静态分析器后,不会报告泄漏。输出始终是正确的。但我感觉不舒服。
答案 0 :(得分:0)