Memory warning when loading google map in UIWebView

≡放荡痞女 提交于 2019-12-25 01:41:15

问题


In my app UIWebView loads Google maps, while using this Direction url == http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=37.774930,-122.419415&daddr=37.7655277,-122.421811&ie=UTF8&z=12,

it throws "Received memory warning" and my app crash.

UIWebview is a subview of UIView in my view controller. I took it as a IBOutlet.

Pls help me with this, it creates lots of trouble for my app.

Thank you in advance...


回答1:


Is your app actually crashing (does the Xcode debugger catch it? can you post the stack trace of the thread which crashed), or is it being shut down by the OS for using too much memory?

You might also try reproducing the crash with NSZombieEnabled - check the Xcode docs for the details on how to do this.




回答2:


.h ///---- #import

@interface WebsiteViewController : UIViewController <UIWebViewDelegate>

{

IBOutlet UIWebView *webView;

}

@property(nonatomic,retain) IBOutlet UIWebView *webView;

.m ///---

-(void)viewDidLoad {
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:@"url"];
[self.webView setScalesPageToFit:YES];
[self.webView loadRequest:request];
[request release]; 
}


来源:https://stackoverflow.com/questions/10189706/memory-warning-when-loading-google-map-in-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!