【发布时间】:2016-10-12 04:31:57
【问题描述】:
我是新人,正在IOS 应用程序开发,让我告诉你,我对内存和内存管理一无所知。当我在玩 tabViewController 时,我制作了两个选项卡和三个 ViewController 并将它们连接 通过 NavigationalController 并将它们链接为像这样的循环:-
navigationController1
firstViewController->secondViewController->thirdViewController->firstViewController
navigationController2
firstViewController->secondViewController->thirdViewController->firstViewController
并在模拟器上运行它们并注意到,一旦我将 ViewControllers 放到堆栈上,内存就会增加 0.1 MB。
然后我在 firstViewController (NavigationController1) 上添加一个大小为 4.5 MB 的单个图像并突然运行应用程序我注意到内存达到了 66 Mb
随着应用程序的启动,当我在堆栈中添加 viewControllers 时,内存以与上次相同的速度增加(0.1 MB)我不明白它背后的原因以及所看到的整体逻辑是什么?
“我很抱歉,因为 tabBar 中没有显示按钮,tabBar Navigation1 和 Navigation2 上有两个标题,而且按钮具有推送视图的方法”
【问题讨论】:
标签: ios xcode memory memory-management uiviewcontroller