Iphone mapKit ,Large Images & Large data causing memory warnings & crashes
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 me开发者_JAVA百科mory 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
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.
精彩评论