官方ViewController programming guide 上面说的,在iOS6以后要这样干: Really?
来源:互联网 发布:淘宝联盟ios版旧版本 编辑:程序博客网 时间:2024/05/21 19:22
官方ViewController programming guide 上面说的,在iOS6以后要这样干:
测试了下,确实可行!
{
[super didReceiveMemoryWarning];
// Add code to clean up any of your own resources that are no longer necessary.
double version = [[UIDevice currentDevice].systemVersion doubleValue];//判定系统版本。
{
// Add code to preserve data stored in the views that might be
// needed later.
( //尼玛,还能这么写!
[self viewDidUnLoad];
self.view = nil;)
self.XXX = nil;
// Add code to clean up other strong references to the view in
// the view hierarchy.
self.view = nil;
}
}
Memory Management
Memory is a critical resource in iOS, and view controllers provide built-in support for reducing their memory footprint at critical times. The UIViewController
class provides some automatic handling of low-memory conditions through itsdidReceiveMemoryWarning
method, which releases unneeded memory.
Prior to iOS 6, when a low-memory warning occurred, the UIViewController
class purged its views if it knew it could reload or recreate them again later. If this happens, it also calls the viewWillUnload
and viewDidUnload
methods to give your code a chance to relinquish ownership of any objects that are associated with your view hierarchy, including objects loaded from the nib file, objects created in your viewDidLoad
method, and objects created lazily at runtime and added to the view hierarchy. On iOS 6, views are never purged and these methods are never called. If your view controller needs to perform specific tasks when memory is low, it should override the didReceiveMemoryWarning
method.
- 官方ViewController programming guide 上面说的,在iOS6以后要这样干: Really?
- iOS App Programming Guide 官方文档
- 苹果官方《Sprite Kit Programming Guide》翻译
- Spark官方文档《Spark Programming Guide》解读
- [Apple官方文档翻译]: NSURLSession Programming Guide
- 官方Spark Programming Guide学习心得(V2.1.0)
- apple官方文档翻译:URL Loading System Programming Guide
- Audio Session Programming Guide(官方文档翻译一)
- Audio Session Programming Guide(官方文档翻译一)
- AVFoundation Programming Guide(官方文档翻译3)Playback - 播放
- AVFoundation Programming Guide(官方文档翻译4)Editing - 编辑
- AVFoundation Programming Guide(官方文档翻译6)Export - 输出
- AVFoundation Programming Guide(官方文档翻译)完整版中英对照
- IOS开发入门:官方文档 Auido Session Programming Guide 翻译
- Spark官方文档翻译:Spark Programming Guide(一)
- 以后有了孩子要起名就在这上面选啊!
- How Pair Programming Really Works
- ios6以后旋转方法
- centos5.5中修改root密码
- Nginx的phase的调用
- 使用 VMControl 2.4 实现多网络的 Power 服务器捕捉和系统部署
- poj1423
- 历史文化知识
- 官方ViewController programming guide 上面说的,在iOS6以后要这样干: Really?
- 罗马字母和希腊字母读法(in math)
- 实例介绍如何配置使用 VMControl 多网络支持功能
- 【phpcms-v9】phpcms-v9上传视频文件时的解决方案
- 通过Eclipse3.1以上启动Tomcat访问不到tomcat管理界面的问题
- Variant 与 内存泄露
- Python的metaclass构建类过程
- 如何打war包和jar包
- 缓存以及javascript高级的补充