How to solve Memory Warning Level-1,then Memory Warning Level-2?
I am using apple standard code for scrolling+zooming+paging after 10 image scrolling and paging my console gives Memory Warning Level-1,Then Memory Warning Level-2 and then crash how can i stop crash my application?Please help me.I have taken this code from http://dev开发者_Go百科eloper.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html
Did you implement the -(void)didReceiveMemoryWarning
? You can release every images that you don't use at this moment.
Keeping all images in an array will prevent you of doing this. Instead, you should create a method that gives you the right image based on its index (like an array) but that manages a cache (i.e. using an array) that you can clean when memory warnings are issued. Also I don't know this sample project by heart but I guess that they use only three controls to display image on the left, current image and image on the left. If not, be sure that other views are released when not useful for display.
It seems the images you use is of greater size.Try to reduce the pixel size and use it.
All the Best.
Each big image must be treated as a set of tiles and load data from the ONLY tile or set of tiles which is / are currently being displayed on the screen.
I dont know exactly how this works but you can google for it, I guess.
精彩评论