Iphone 地图套件、大图像和地图大数据导致内存警告&崩溃
我正在开发一个应用程序,但现在我陷入困境。我认为这是由于缺乏早期规划造成的。实际上,我之前并不知道我会在我的应用程序中获取如此多的数据,这就是为什么现在在我的应用程序的最后阶段,我收到内存警告。
基本上我正在使用 MapKit 并从服务器获取数据,将它们存储在数组中并使用该数据在地图上显示某些内容,这是我从服务器获取的大量数据。
在其他一些视图中,我从服务器下载大图像,并再次下载一些大数据以显示在图像上,并使用数组来存储该数据。
我已经检查过应用程序中没有泄漏。但问题是,当我放大和缩小地图并来回移动,然后再次放大和缩小地图时,我会收到内存警告,我以前的视图将被卸载。问题是以前的视图也从服务器获取数据,并且由于我的应用程序目标用户将是 3g 用户而不是 WIFI,所以如果他们一次又一次返回并再次从服务器下载整个数据,这将非常困难。
所以基本上我的问题是如何存储大数据?有没有办法减少 MapKit 的内存使用量或者这是一个已知的错误?请帮我。非常紧急。我被困在里面很久了,无法得到任何解决方案
I am working on an app and now I am stucked. I think I this is due to lack of earlier planning. Actually I earlier didnt know that I will be getting so much of data in my app and thats why now at the final stages of my app , I am getting memory warnings.
Basically I am using a MapKit and getting the data from my server , store them in arrays and use that data to display something on map, thats a huge amount of data which I am getting from server .
In some other view , I am downloading large images from server and again some large data to display on image and using arrays to store that data.
I have checked there are no leaks in the app. But the problem is that when I zoom in and out of the map and go back and forth and then again zoom in and out of the map, I recieve memory warnings, my previous views are unloaded. The problem is that previous views also get their data from server and since my app target users will be 3g users and not WIFI , it will be very difficult if again and again they go back and whole data again gets downloaded from server.
SO basically my problem is that how to store large data? Is there a way to reduce the memory usage of MapKit or is it a known bug? Please help me. its very urgent . I m stucked in it from long and not able to get any solution
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ASIHTTPRequest 并设置 ASIDownloadCache。这样,当控制器被迫卸载数据并必须重新下载时,数据已经在本地可用。
You could use ASIHTTPRequest and setup a ASIDownloadCache. This way when a controller is forced to unload the data and has to re-download it, the data is already locally available.