In my app,i have around 50 nib files.And i Used ARC on..means with automatic reference counting .. i used navigation controller for navigation.so With every navigation memory indicator in x-code is continuous increasing..and crash..any solution for memory management ?
在我的应用中,我有大约50个nib文件。我用弧线。有自动参考计数的方法。我用导航控制器导航。所以随着x-code中每个导航内存指示器的不断增加。和崩溃。任何内存管理解决方案?
2 个解决方案
#1
1
You have not provided us enough information to diagnose your problem. Could be leaks (such as that caused by strong reference cycles, e.g. sloppy use of repeating timers). Could be abandoned memory (such as caused by some circular logic in your navigation). No way to diagnose on the basis of what you've shared thus far.
你没有给我们提供足够的信息来诊断你的问题。可能是泄漏(例如由强引用周期引起的泄漏,例如草率地使用重复计时器)。可能会被放弃内存(比如由导航中的一些循环逻辑引起)。没有办法根据到目前为止您所共享的内容进行诊断。
I'd suggest you watch WWDC 2013 video, Fixing Memory Leaks (for registered developers). This builds upon the WWDC 2012 video iOS App Performance: Memory, which you might want to watch first. These walk you through the categories of problems and introduce you to some techniques for using Instruments to diagnose the problem.
我建议您观看WWDC 2013视频,修复内存泄漏(为注册开发人员)。它基于WWDC 2012视频iOS应用的性能:内存,你可能想先看一下。这些内容将带您浏览问题的类别,并向您介绍使用工具诊断问题的一些技术。
#2
1
To navigate instantly back and forth to plenty of view controllers , you should use UIPageViewController
, you can go through the documentation provided by apple at the below link:
要立即导航到大量视图控制器,您应该使用UIPageViewController,您可以查看苹果在以下链接提供的文档:
https://developer.apple.com/library/ios/documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
You can also navigate back and forth by swiping the screen as well when you have implemented UIPageViewController
, if you would like to stop that behavior at that time you can disable the horizontal scrolling of pages:
你也可以通过滑动屏幕来来回导航当你实现UIPageViewController时,如果你想要停止那个时候你可以禁用水平滚动页面:
#1
1
You have not provided us enough information to diagnose your problem. Could be leaks (such as that caused by strong reference cycles, e.g. sloppy use of repeating timers). Could be abandoned memory (such as caused by some circular logic in your navigation). No way to diagnose on the basis of what you've shared thus far.
你没有给我们提供足够的信息来诊断你的问题。可能是泄漏(例如由强引用周期引起的泄漏,例如草率地使用重复计时器)。可能会被放弃内存(比如由导航中的一些循环逻辑引起)。没有办法根据到目前为止您所共享的内容进行诊断。
I'd suggest you watch WWDC 2013 video, Fixing Memory Leaks (for registered developers). This builds upon the WWDC 2012 video iOS App Performance: Memory, which you might want to watch first. These walk you through the categories of problems and introduce you to some techniques for using Instruments to diagnose the problem.
我建议您观看WWDC 2013视频,修复内存泄漏(为注册开发人员)。它基于WWDC 2012视频iOS应用的性能:内存,你可能想先看一下。这些内容将带您浏览问题的类别,并向您介绍使用工具诊断问题的一些技术。
#2
1
To navigate instantly back and forth to plenty of view controllers , you should use UIPageViewController
, you can go through the documentation provided by apple at the below link:
要立即导航到大量视图控制器,您应该使用UIPageViewController,您可以查看苹果在以下链接提供的文档:
https://developer.apple.com/library/ios/documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
You can also navigate back and forth by swiping the screen as well when you have implemented UIPageViewController
, if you would like to stop that behavior at that time you can disable the horizontal scrolling of pages:
你也可以通过滑动屏幕来来回导航当你实现UIPageViewController时,如果你想要停止那个时候你可以禁用水平滚动页面: