Results 1 to 5 of 5
Discuss how remove a webView, because ...... at the iPhone Developer Exchange - Hackint0sh.org; Please: how should I remove a webView when call another ? if I run my ...
  1. #1
    Advanced Array

    Join Date
    Dec 2007
    Posts
    45
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Exclamation how remove a webView, because ......

    Please:
    how should I remove a webView when call another ?

    if I run my small app with activity monitor (instruments)
    you can see each time you call a webView then the memory increases, and add 4 or 5 MB each time pressing the button (calling a local HTML)
    if you press 8 or 9 times the HTML button, the app crash. (then i need to LITERALY remove any webview before show another)

    my question is:
    how can I remove a webView before call another webView please.

    here is the url of the small project to see see the problem.

    http://www.1572-8.com/zzz-xcode-test...eton-2html.zip
    Last edited by unjosnav; 12-23-2008 at 07:01 PM.



  2. #2
    Rookie Array

    Join Date
    Jul 2008
    Posts
    14
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Well, I always try to avoid Objective-C because of its IMHO obscure memory handling and I'm therefore no O-C expert, but I bet the reason for your leak is that the reference counter of your webView object is larger then one, because you added it as sub-view to myHTML_ojo1.

    Therefore your manual release won't be enough to destroy webView (the myHTML_ojo1 still has a reference to it). So you should remove the webView from myHTML_ojo1.

    But why do you want to destroy the webView? Since you're recreating it immediately afterwards that makes no sense at all. Create one webView at app start and reuse it.

  3. #3
    Advanced Array

    Join Date
    Dec 2007
    Posts
    45
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Exclamation

    because if you press html button, and clean, and again, press the html button, and again clean...... etc etc etc
    the app crash.

    open the proyect again and try it, press and clean.... etc
    thats means you can see only 8 or 9 html (files) then crash.
    please help me to fix it. (begging you)

    any help are welcome.

    important note:
    i have all this 7 app on the app store (to sell)
    http://itunes.apple.com/WebObjects/M...t?id=293824811

    but all of them crash if you use for more than 4 minutes , because i dont know how to clean the memory.
    I can gift all of them (redem code) to see them crash, but realy need help.

    Quote Originally Posted by Last_Inquisitor View Post
    So you should remove the webView from myHTML_ojo1.
    could you teach me (or some one) how remove webview from IBOutlet UIView *myHTML_ojo1; please ?

    I upload a new proyect with the real problem, the app crash if you use for 4 minutes , please help !
    Last edited by unjosnav; 12-23-2008 at 07:01 PM.

  4. #4
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Smile

    I just make two changes in your code as below and press 50 times in my iPhone and didn't crash

    Code:
    if (webView == nil)
    	webView = [[UIWebView alloc] initWithFrame:[myHTML_ojo1 bounds]];
    
    if (webView == nil)
    		webView = [[UIWebView alloc] initWithFrame:[myHTML_ojo2 bounds]];
    .
    .
    .
    .
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  5. #5
    Advanced Array

    Join Date
    Dec 2007
    Posts
    45
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Exclamation

    Thanks You , but on simulator works fine, but when deploy on device is crashing again.
    Last edited by unjosnav; 12-27-2008 at 03:36 PM.


 

 

Similar Threads

  1. MacNN: MBS plug-in for Filemaker reaches v2.1, improves WebView
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 10-27-2010, 03:10 PM
  2. Extracting Data from Webview
    By nigel150 in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 06-12-2009, 04:16 PM
  3. [problem] webView and Tabbar, please help
    By iNinja in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 08-13-2008, 09:04 PM
  4. AT&T sim... how to remove
    By patientlywaiting in forum Turbo-, Supersim and Simcloning Solution
    Replies: 1
    Last Post: 02-10-2008, 05:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 12:48 PM.
twitter, follow us!