我的脑型模型界定了一种NSMutableArray财产。
@property (retain, nonatomic) NSMutableArray *stockColors;
在脑膜炎期间, mu阵填充了物体。
在我看来,控制者认为DidLoad功能是我确实这样做的。
*Brain brain = [[Brain alloc]init];
NSLog(@"Brain stockColors is %@", brain.stockColors);
这运转良好,并按预期显示记忆。
Then in the same view controller I have an "addButtonPressed" action declared linked to a UIButton in the .xib.
在我的补充行动中,如果我尝试并做同样的记录的话。
NSLog(@"Brain stockColors is %@", brain.stockColors);
该方案坠毁!
If I do
NSLog(@"Brain stockColors is %@", brain);
I get an address for the brain... so the brain exists.. but for some reason it seems that brain.stockColors is getting released or something by the time I get to the addButtonPressed action.
谁能解释为什么会使其自动释放?
增 编