开发者

IOS Memory Management and Application Foreground/Background

开发者 https://www.devze.com 2023-03-11 18:25 出处:网络
In my IOS application, I have a NSDate* property that is marked as retain When My application becomes active again, the properties value has been re开发者_运维百科leased.

In my IOS application, I have a NSDate* property that is marked as retain

When My application becomes active again, the properties value has been re开发者_运维百科leased.

Did I misunderstand how properties and memory management work, and how can I guard against this?


Its obvious that something is sending a release or dealloc message somewhere. If I were you I would create a deep copy like:

NSItem *ref = [[NSItem alloc] initWithData: x];

As far as finding out what is happening to that item in question I suggest you use NSZombie as an env variable as step through the call stack to see where its getting released.

Best of luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消