Iphone UIWebView应用程序因信号“而崩溃”;0“;加载pdf并完成一些猴子测试时
我正在使用UIWebView加载PDF文件。我从UITableViewController子类来到webview。 PDF的大小很好 问题 每当我测试应用程序时。它崩溃了,说:Iphone UIWebView应用程序因信号“而崩溃”;0“;加载pdf并完成一些猴子测试时,iphone,pdf,memory-management,memory-leaks,uiwebview,Iphone,Pdf,Memory Management,Memory Leaks,Uiwebview,我正在使用UIWebView加载PDF文件。我从UITableViewController子类来到webview。 PDF的大小很好 问题 每当我测试应用程序时。它崩溃了,说: Program received signal: “0”. Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib
Program received signal: “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
我知道数据格式化程序是调试程序的错误。但是信号:“0”这与内存有关(我在从springboard终止时也看到了这个信号)
我在视图上设置了一个断点:我收到了记忆警告,但他从未去那里
有些PDF太大(7.5+MB)。
如果大的PDF是个问题,那么请建议其他方法,让这些大的PDF加载到iphone上。
下面是代码片段
//////////////////// for PDFs //////////////////
-(void)webViewloadRequest:(NSString *)URLString
{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MY_WebViewController urldecode:contentURL]]];
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
if(![request isEqual:[NSNull null]])
[self.myWebView loadRequest:request];
//[self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:contentURL]]];
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
// finished loading, hide the activity indicator in the status bar
[webActivityIndicator stopAnimating];
[self.myWebView.delegate release]; // read this somewhere in SO to retain and release the delegate.
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
NSLog(@"DOCS ABOUT TO CRASH !!!");
[self hideModalActivityIndicator];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Memory Warning!" message:@"The file was too large to load.\n So the request is terminated." delegate:self cancelButtonTitle:nil otherButtonTitles:@"ok",nil];
//[self retain];
alert.tag=MEMORY_WARNING_ALERT;
[alert show];
[alert release];
alert = nil;
// Release any cached data, images, etc. that aren't in use.
}
需要
一旦收到内存警告,请建议一些刷新内存的方法
谢谢基本上,当收到警告时,您应该释放内存。因此,请粘贴一些可以释放的缓存对象代码。这样我们可以帮助您更有效地管理内存。@Praveen,我的问题之一是释放什么?有没有办法清除缓存?表示在此方法中要删除的文件下载量。(didReciewMemoryWarning)