I have made an iPad application that uses the Apple sample code called "PageControl". I did some changes to it, so i can load local HTML files inside an UIWebView ,inside an UIScrollView. Those HTML files uses CSS to style the layout, and javascript to get some small animations and transitions. The HTML file can also contain video.
At the moment i have 7 pages that each has a UIScrollView + UIWebView. I think i have some kind of memory problem, since it crashes some times and its quite heavy to navigate between the 7开发者_高级运维 pages.
Should i somehow release the UIScrollView / UIWebView for page 1 when i go to page 2 or something like that ?
Thanks in advance!
I forgot what "PageControl" is about but :
1°) Displaying UIWebView + UIScrollView can take A LOT of memory. Because it needs often images & co, so your app memory limit if fast at his limit.
2°) If you can, release your scrollView + webView when you can.
3°) Don't forget to implement the following lines in each controller you have to clear some memory
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
Good Luck !
精彩评论