苹果手机。不应该按下主页按钮导致调用UIApplicationDelegate的dealloc [英] iPhone. Shouldn't hitting the home button cause UIApplicationDelegate's dealloc to be called
问题描述
我把NSLogs放在我的所有类中,包括我的UIApplicationDelegate子类。我很好奇 - 有点紧张 - 当我按下主页按钮时,为什么我没有看到它们回应任何东西。我在XCode模拟器中运行。
I have put NSLogs in all my classes including my UIApplicationDelegate subclass. I am curious - and a bit nervous - about why I am not seeing them echo anything when I press the home button. I am running in the XCode simulator.
由于iPhone / iPad一次运行一个应用程序,没有按下主页按钮丢弃正在运行的应用程序的所有痕迹?
Since iPhone/iPad runs a single app at a time, doesn't hitting the home button discard all traces of the running app?
谢谢,
Doug
Thanks,
Doug
推荐答案
当应用程序终止时,它的内存将被释放。 Dealloc没有被叫,它没有通过去或收取200美元。这是正常的和有意的。
When an app is terminated, its memory is simply freed. Dealloc is not called, it does not pass go or collect $200. This is normal and intended.
这篇关于苹果手机。不应该按下主页按钮导致调用UIApplicationDelegate的dealloc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!