【问题标题】:Abandoned memory after Modal segue with StoryBoard and ARC使用 StoryBoard 和 ARC 进行模态转场后被遗弃的记忆
【发布时间】:2012-06-23 04:42:46
【问题描述】:

我在使用 StoryBoard 增加内存时遇到问题。
我使用模态序列来进入下一个或上一个。视图控制器。

Sample UIStoryBoard
当我运行 Instruments 时,我可以看到 Viewcontrollers 永远不会超出内存。
因此,它们被添加并添加每个 segue。

Instruments Allocations

我怎样才能从内存中取出这个 Viewcontroller?

【问题讨论】:

    标签: ios memory-management storyboard segue abandoned-memory


    【解决方案1】:

    我认为您正在使用模态转场返回上一个场景。然后,当每个 segue 都在执行时,就会有新的分配......

    只要用这个方法回到之前的场景:

    [self dismissViewControllerAnimated:YES completion:nil]; 
    

    并删除用于 go backing 的第二个模态转场。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-20
      • 2016-02-11
      • 2022-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-17
      相关资源
      最近更新 更多