我继承了一个代码库,只是注意到当我关闭应用程序(点击主页按钮),然后尝试使用任务切换器(双击主页按钮)切换到该应用程序时,我的应用程序出现在任务切换器中一张完全黑色的图片,而不是我正在查看的最后一页的预期屏幕截图。
这是否发生在其他人身上?有什么可能导致它的想法吗?正如我所说,我继承了这个代码库,所以我对可能导致这种情况的原因感到遗憾。
Matt在接受的答案中找出了下面发生的事情,但我想我会在这里添加一些日志,其他任何人都会遇到这个问题:
// Logs showing a correct shutdown
Sep 26 16:48:14 iPod-touch iap2d[2096] <Warning>: process HTTPLeakTester is now running in the background
Sep 26 16:48:15 iPod-touch iap2d[2096] <Warning>: process HTTPLeakTester is now suspending
// Logs Showing my killed app's shutdown
Sep 26 16:47:19 iPod-touch iap2d[2096] <Warning>: process ***** is now running in the background
Sep 26 16:47:19 iPod-touch SpringBoard[42] <Warning>: BSXPCMessage received error for message: Connection interrupted
Sep 26 16:47:19 iPod-touch SpringBoard[42] <Warning>: Application 'UIKitApplication:*****[0x5d54]' exited voluntarily.
Sep 26 16:47:19 iPod-touch assertiond[56] <Error>: assertion failed: 12A365: assertiond + 62335 [032107D4-DB2B-36DD-AC98-6060D8C62F73]: 0x3
Sep 26 16:47:19 iPod-touch assertiond[56] <Warning>: pid_suspend failed for <BKNewProcess: 0x16614640; *****; pid: 2386>: Unknown error: -1, Unknown error: -1
Sep 26 16:47:19 iPod-touch Unknown[56] <Error>:
Sep 26 16:47:19 iPod-touch assertiond[56] <Warning>: Could not set priority of <BKNewProcess: 0x16614640; *****; pid: 2386> to 2, priority: No such process
Sep 26 16:47:19 iPod-touch assertiond[56] <Warning>: Could not set priority of <BKNewProcess: 0x16614640; *****; pid: 2386> to 4096, priority: No such process
Sep 26 16:47:19 iPod-touch assertiond[56] <Error>: assertion failed: 12A365: assertiond + 62335 [032107D4-DB2B-36DD-AC98-6060D8C62F73]: 0x3
Sep 26 16:47:19 iPod-touch UserEventAgent[17] <Warning>: id=***** pid=2386, state=0
Sep 26 16:47:19 iPod-touch iap2d[2096] <Warning>: process ***** is now switching to other state
Sep 26 16:47:19 iPod-touch iap2d[2096] <Warning>: process ***** is now terminated
答案 0 :(得分:1)
我猜这个应用程序是错误管理内存(或者当它背景化时可能会尝试做其他错误的事情,例如使用大量的CPU太长时间)。毕竟,你继承了它,所以你不知道,这不是你的错。结果是,当我们进入后台时,监视程序进程看到该应用程序表现不佳并立即将其杀死。
如果您使用应用切换器进入后台,切换到黑色快照并启动,并且应用程序随后从头开始启动,您可以确认这一点。这证明它已在后台终止。
如果猜测是正确的,那么当应用程序是一个更好的公民时,问题就会消失。