Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:19:13+00:00 2026-05-22T18:19:13+00:00

I am getting the following error: * -[URLViewController respondsToSelector:]: message sent to deallocated instance

  • 0

I am getting the following error:

* -[URLViewController respondsToSelector:]: message sent to deallocated instance 0xdb5c3b0

and I am quite confused on how to start debugging this. Can someone please give me some pointers on where to start to look at?

Here’s some code if you want to see. This is actually a URL interceptor, so that every links opens up in a presentModalViewController

- (BOOL)openURL:(NSURL *)url{
    URLViewController * web = [[URLViewController alloc] init];
    web.url = url;
    UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:web];
    [nav.navigationBar setTintColor:[UIColor blackColor]];
    [nav setModalPresentationStyle:UIModalPresentationFormSheet];
    [self.detailViewController presentModalViewController:nav animated:NO];
    [web release];
    [nav release];
    return YES;
}

If the URLViewController implementation is any interest, here it is:

@implementation URLViewController
@synthesize webview;
@synthesize url;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (IBAction) done:(id) sender
{
    [self dismissModalViewControllerAnimated:YES];   
}

- (IBAction) openInSafari:(id) sender
{
   [(CVore*)[CVore sharedApplication] openURL:url withOverride:NO];
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.webview.delegate = self;
     NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webview loadRequest:requestObj];
    [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)]]; 
     [self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(openInSafari:)]]; 
    // Do any additional setup after loading the view from its nib.
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSString* title = [webView stringByEvaluatingJavaScriptFromString: @"document.title"];
    self.title = title;
    //self.navigationItem.title = title;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return YES;
}

@end

UPDATE:
After tracking this, I think my mistake here is I need to set UIWebView delegate to nil before the [super dealloc] is this correct? As when I did this, it no longer crashes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:19:14+00:00Added an answer on May 22, 2026 at 6:19 pm

    You’ve released your URLViewController instance to soon or you’ve not retained it. Also check for where you’ve used = instead of using the synthesized setter (potentially creating a zombie), if any. It’s hard to be helpful without any code to look at.

    __

    When the URLViewController has been released and deallocated, your webview really should be too by the time you call to super because it’s a class member. However, objects must not retain their delegates (to prevent a “retain-cycle”) so if you’re some how putting an extra retain on your webview, here or elsewhere, its delegate can still end up being nil and give the resulting crash. For example, do you have a retain synthesizer for webview? And have you called this at any time?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We’re getting the following error message when we click on Search Settings for a
Am getting following error message on calling WCF service: The formatter threw an exception
I am getting following error message: java.lang.IllegalStateException: Neither BindingResult nor plain target object for
I am getting following error while exporting data to excel sheet ERROR: Message :
Getting following error message when I try to fetch JSON response into my app.
I getting the following error when I try to connect to my server app
I am getting the following error: Access denied for user 'apache'@'localhost' (using password: NO)
I'm getting the following error when trying to run a JSP. I'm using Tomcat
I'm getting the following error when trying to build my app using Team Foundation
I am getting the following error whenever I click on a postbacking control HttpException

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.