didReceiveMemoryWarning未在活动应用中调用

时间:2011-09-06 17:51:40

标签: ios ipad memory

我有一个使用大量数据的应用程序,当我看到控制台时,我看到以下行,然后应用程序被杀死。

Sep  6 13:37:35 unknown SpringBoard[29] <Warning>: Received memory warning. Level=1
Sep  6 13:37:35 unknown configd[25] <Notice>: jetsam: kernel memory event (90), free: 556, active: 3993, inactive: 1967, purgeable: 0, wired: 15073
Sep  6 13:37:35 unknown SpringBoard[29] <Warning>: Received memory warning. Level=2
Sep  6 13:37:35 unknown configd[25] <Notice>: jetsam: kernel memory event (95), free: 556, active: 1889, inactive: 944, purgeable: 0, wired: 15088

这对我有意义,没有意义的部分是我的app delegate没有收到applicationDidReceiveMemoryWarning消息,我的视图控制器没有收到didReceiveMemoryWarning。

有没有人见过这个或有任何建议来帮助我找出问题所在。应用程序可见时会发生这种情况,因此它不在后台。如果它有任何区别我正在使用iPad 1

提前致谢!

1 个答案:

答案 0 :(得分:0)

我在iPad设备上运行时已经看过这个(虽然不在iPhone / iPod上)。我仍在寻找替代品,但我目前的解决方案是根据计时器(放置在我的app委托中,在“didFinishLaunchingWithOptions”中)强制设备上的低内存警告:

// iPad doesn't seem to get the low memory warnings correctly - it just eventually crashes.  We're going to force them here every 20 seconds.
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    [NSTimer scheduledTimerWithTimeInterval:20.0 target:[UIApplication sharedApplication] selector:@selector(_performMemoryWarning) userInfo:nil repeats:YES];

这绝对有气味,我不确定苹果是否会接受它。但是,它似乎使我的iPad现在正常工作。