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 8047351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:04:13+00:00 2026-06-05T06:04:13+00:00

I encountered a little problem with my app. It is a simple problem but

  • 0

I encountered a little problem with my app. It is a simple problem but i can not find out what is the cause of crash.

I have a simple viewcontroller with only a webview (created and linked in storyboard) (ARC enabled):

@implementation BPActivateController
@synthesize mainWebView;

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {

    }
    return self;
}

- (void)viewDidLoad
{
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/test.php?code=%@", BASE_URL, [[NSUserDefaults standardUserDefaults] objectForKey:@"uniqueIdentifier"]]]; 
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [mainWebView loadRequest:requestObj];

    [super viewDidLoad];
}


- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSString *html = [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
    if ([html rangeOfString:@"<h1>Not Found</h1>"].location != NSNotFound)
    {
        [self.navigationController popViewControllerAnimated:YES];
        NSLog(@"pop the view controller");
    }
}

- (void)viewDidUnload
{
    [self setMainWebView:nil];
    [super viewDidUnload];
}

The first time the view opens the popViewControllerAnimated is called and the user is redirected back to the last viewcontroller. But when the view is opened again, gives me a EXEC_BAD_ACCESS after the popViewControllerAnimated is called. When i enable the Zombie code gives me the following trace:

2012-06-04 11:51:12.717 actusmedicus[410:707] pop the view controller
2012-06-04 11:51:12.720 actusmedicus[410:707] *** -[BPActivateController respondsToSelector:]: message sent to deallocated instance 0xc6d95b0

I have tried several things but still is is not clear what selector is being called. I suspect that the webview is still busy..

Anyone has an idea that gets me back on track?


[EDIT]

The EXEC_BAD_ACCESS is fixed by setting the delegate of the webview to nil.
But the real problem is still there, the first time the view is pushed on the UINavigation stack, the web view does load and after a 404 the popViewControllerAnimated is successfully executed. But the second time we push the same view on the UINavigation stack (the same way we did the first time) The popViewControllerAnimated does not do anything. I have checked if it is nil but that does not seem to be the problem..

My first idea was that it runs in another thread and the UINavigationcontroller does not exist there. I ruled out that possibility with the help of performSelectorOnMainThread.

Finally i added a button to call popViewControllerAnimated manually and that works every time, so why doesn’t it work when i call it programmatically?

  • 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-06-05T06:04:15+00:00Added an answer on June 5, 2026 at 6:04 am

    I suspect that the webview is still busy..

    If so then in your dealloc call the stopLoading method.

    You should also set the delegate to nil in the dealloc.

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

Sidebar

Related Questions

Going deeper in C#, I have encountered a little (strange) problem with object reference
I'm working with MT for the first time and have encountered a little problem
I've encountered a little problem selecting only the needed model in QueryOver. Here my
I'm working on a simple app to learn Cocoa and I've encountered a little
I'v encountered a problem with Google Maps on Android. In my app I have
Being still a little unfamiliar with Spring, I have encountered a problem that makes
While playing with NLP I've been encountered with little problem: switch(var1) { case Variant1_1:
I have encountered below scenarion and I am confused a little on how cond
I've encountered a problem in Firefox (does not happen in IE) where my Javascript
I have encountered a problem in my program that has me somewhat stumped. I

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.