admin 管理员组文章数量: 1086019
清除ios的缓存
,你是否在使用高德地图或百度地图时内存持续上涨而烦恼啊?教你一招搞定它,把缓存清理下就爽多了。当然你内存泄漏了,神也救不了你。
在AppDelegate.m或AppDelegate.mm增加这个代码
- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
{NSLog(@"清除所有缓存");[[NSURLCache sharedURLCache] removeAllCachedResponses];
}
iphone4手机使用3D地图可能出现内存不足,内存不足时的例子日志如下:
2015/09/06 16:17:56:009 AppDelegate.m:-[AppDelegate applicationDidReceiveMemoryWarning:]:438 Debug:清除所有缓存
2015/09/06 16:18:14:389 MoneyAccountViewController.m:-[MoneyAccountViewController showClass]:138 Debug:函数
2015/09/06 16:18:14:399 MoneyAccountViewController.m:-[MoneyAccountViewController tableView:numberOfRowsInSection:]:88 Debug:函数
2015/09/06 16:18:24:084 MoneyAccountViewController.m:-[MoneyAccountViewController showClass]:138 Debug:函数
2015/09/06 16:18:24:085 MoneyAccountViewController.m:-[MoneyAccountViewController tableView:numberOfRowsInSection:]:88 Debug:函数
2015/09/06 16:18:34:800 AppDelegate.m:-[AppDelegate applicationDidReceiveMemoryWarning:]:438 Debug:清除所有缓存
2015/09/06 16:19:04:968 AppDelegate.m:-[AppDelegate applicationDidReceiveMemoryWarning:]:438 Debug:清除所有缓存
2015/09/06 16:19:20:530 AppDelegate.m:-[AppDelegate applicationDidReceiveMemoryWarning:]:438 Debug:清除所有缓存
2015/09/06 16:19:32:599 AppDelegate.m:-[AppDelegate applicationDidReceiveMemoryWarning:]:438 Debug:清除所有缓存
本文标签: 清除ios的缓存
版权声明:本文标题:清除ios的缓存 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1693410940a220358.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论