UIWebView EXEC_BAD_ACCESS crash

Discussion in 'iOS Programming' started by sleaver, Mar 30, 2011.

  1. sleaver
    Expand Collapse
    macrumors member

    Joined:
    Jul 21, 2010
    #1
    Hi

    To start with I have a view hierarchy as follows in a navigation controller:

    ContainerView
    ---- SubContainerView
    -------- UIWebView (for this case)

    If I start loading a URL in the UIWebView but then navigate back in the navigation controller I get a EXEC_BAD_ACCESS on the following line in main.m:

    PHP:
    int retVal UIApplicationMain(argcargvnilnil);
    I read that its because of the order of delegate being released so I added the following code in my view controller as I have a property for the webview and load it into the subContainerView:

    PHP:
    - (void)viewDidDisappear:(BOOL)animated {
        [
    externalView stopLoading];
            
    externalView.delegate nil;
            [
    externalView release];
    }
    However it still crashed so I added zombies and get the following:

    Any ideas because I've run out of then?

    Edit - I'm using Xcode 4 and having trouble finding anything so if I need anything please point me in the right direction!
     
  2. RonC
    Expand Collapse
    macrumors regular

    Joined:
    Oct 18, 2007
    Location:
    Chicago-area
    #2
    How is the property set up? Does something retain that delegate? If not, should something be retaining it?

    The message you're getting tells you that the object you're trying to send the message to (delegate) has been reclaimed by the garbage collector because it's reference count has fallen to 0.
     

Share This Page