release memory calling HTMLs files
Hi every one !....
I have a UIView with 4 buttons, and every button call a file.HTML (4 html in total)
but in instrument, on activity monitor every time I press a button calling a HTML, the memory increases, and add 4 or 5 MB each time pressing.
when the app reach 37 MB (on activity monitor) then the app crash.
I just can press only 7 times any button, then the app crash.
my app is not cleaning (release) each HTML, how can I fix please.
how can I release memory ?
i have this code on each button....
I realy, realy need any kind of help.
thanks a lot !
I have a UIView with 4 buttons, and every button call a file.HTML (4 html in total)
but in instrument, on activity monitor every time I press a button calling a HTML, the memory increases, and add 4 or 5 MB each time pressing.
when the app reach 37 MB (on activity monitor) then the app crash.
I just can press only 7 times any button, then the app crash.
my app is not cleaning (release) each HTML, how can I fix please.
how can I release memory ?
i have this code on each button....
Quote:- (IBAction)IBAc_ojo1: (id)sender {
if (webView != nil)
[webView release];
webView = [[UIWebView alloc] initWithFrame:[myHTML_ojo1 bounds]];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"head-mandiblev" ofType:@"html"];
NSString *html = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[webView loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath] isDirectory:YES]];
[webView setScalesPageToFit:YES];
[myHTML_ojo1 addSubview:webView];
I realy, realy need any kind of help.
thanks a lot !
I'm not at my computer, but I assume addSubview retains the view. Do you remove the webView from its superview before adding the new one?
how should I remove a webView before call a new one please ?
thanks for your help !
and here is my small project to download
you can see the code.
http://www.1572-8.com/zzz-xcode-testing/...n-html.zip
thanks for your help !
and here is my small project to download
you can see the code.
http://www.1572-8.com/zzz-xcode-testing/...n-html.zip
maximile Wrote:I'm not at my computer, but I assume addSubview retains the view. Do you remove the webView from its superview before adding the new one?
i dont know how to do it, please could you show me how to do it ?
thansk a lot !
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
__fastcall calling convention on iPhone | Dimka | 3 | 7,230 |
Aug 21, 2010 03:35 PM Last Post: OneSadCookie |
|
removeFromSuperview not calling dealloc of view - SOLVED | BeyondCloister | 5 | 20,998 |
Aug 11, 2010 01:18 PM Last Post: BeyondCloister |
|
Calling Obj-C from C | miq01 | 7 | 6,760 |
May 1, 2009 09:19 PM Last Post: ThemsAllTook |