我继承了一个代码库,只是注意到,当我关闭应用程序(点击主页按钮),然后尝试使用任务开关(双击主按钮)切换到该应用程序时,我的应用程序出现在任务切换程序中,其图像完全是黑色的,而不是我正在查看的最后一页的预期屏幕截图。
其他人也发生过这种事吗?对是什么原因有什么想法吗?正如我所说的,我继承了这个代码库,因此我对可能导致这种情况的原因感到茫然。
哑光在被接受的答案中指出了下面发生了什么,但我想我应该在这里添加一些日志,以防其他人遇到这种情况:
// 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发布于 2014-09-26 18:49:02
我猜这个应用程序对内存的管理不善(或者当它在后台运行时,可能会尝试做其他错误的事情,比如使用大量的CPU太长时间)。毕竟,你继承了它,所以你不知道,这不是你的错。结果是,当我们进入后台,看门狗进程看到应用程序的不良行为,并草草地杀死它。
如果您使用应用程序开关进入后台,切换到黑色快照并启动,如果应用程序从零开始启动,您可以确认这一点。这证明它是在背景中终止的。
如果这个猜测是正确的,那么当应用程序是一个更好的公民时,问题就会消失。
https://stackoverflow.com/questions/26065080
复制相似问题