EXC_BAD_ACCESS When using loadRequest

Discussion in 'iOS Programming' started by Mordicaii, Jul 1, 2009.

  1. macrumors newbie

    Joined:
    May 2, 2009
    #1
    I am trying to load a page in a UIWebView, but whenever I press the button I set to do so, I get a `EXC_BAD_ACCESS' error. What does this mean, and what can I do about it.

    Oddly, here is the only code I have changed.
    WebController.m
    Code:
    - (IBAction)goToMainPage:(id)sender {
    	NSURL *url = [NSURL URLWithString:@"http://www.bungie.net/forums/topics.aspx?forumID=10"];
    	[webView loadRequest:[NSURLRequest requestWithURL:url]];
    	[url release];
    }
    
    The_FloodViewController.m
    Code:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
    	if (interfaceOrientation == UIInterfaceOrientationPortrait) {
    		return YES;
    	}
    	if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
    		return YES;
    	}
    	if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
    		return YES;
    	}
    	if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
    		return YES;
    	}
    }
    Thank you!
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You're over-releasing the url object. Remove the '[url release];' line.
     

Share This Page