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

  • Home
  • SEARCH
  • 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 8726795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:19:15+00:00 2026-06-13T08:19:15+00:00

I have a ViewController that slides up. When you click Save it sends a

  • 0

I have a ViewController that slides up. When you click “Save” it sends a request to the server. When the request is done, it dismisses the ViewController. I switched the NSURLConnection over to using async and blocks (https://github.com/rickerbh/NSURLConnection-Blocks). Dismissing the ViewController now throws “Thread 2: Program received signal: EXC_BAD_ACCESS”. I’m using ARC, if that matters.

- (IBAction) savePressed
{
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.com/items/create"]];

    //NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
    [NSURLConnection asyncRequest:request success:^(NSData *data, NSURLResponse *response) {
        [self close];
    } failure:^(NSData *data, NSError *error) {
        [self close];
    }];
}

- (void) close
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

Here is the log

2012-10-24 10:32:43.780 Prayrbox[22268:1703] bool _WebTryThreadLock(bool), 0x1f21fd90: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
1   0x347dc927 WebThreadLock
2   0x36718615 <redacted>
3   0x366d0a85 <redacted>
4   0x3678d789 <redacted>
5   0x366c0637 <redacted>
6   0x366d50e7 <redacted>
7   0x368c1f11 <redacted>
8   0x366d4969 <redacted>
9   0x36744745 <redacted>
10  0x366907ad <redacted>
11  0x7ef71 -[ComposeViewController close]
12  0x7eec5 __36-[ComposeViewController savePressed]_block_invoke_0
13  0x82d8f __56+[NSURLConnection(Blocks) asyncRequest:success:failure:]_block_invoke_0
14  0x37e8811f <redacted>
15  0x37e96259 <redacted>
16  0x37e963b9 <redacted>
17  0x37b30a11 <redacted>
18  0x37b308a4 start_wqthread
[Switching to process 10755 thread 0x2a03]
[Switching to process 10755 thread 0x2a03]
[unknown](gdb) 

I have spent 2 hours searching for help on this. If anyone knows what could help, please speak up! 🙂

  • 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-13T08:19:16+00:00Added an answer on June 13, 2026 at 8:19 am

    At first thought, I would agree with the above comment that you might be on the wrong thread when dismissing the view.

    UI Stuff should be done on Main, so to enforce that, you can do:

    -(void) close {
        if([NSThread isMainThread]) {
            [self dismissViewControllerAnimated:YES completion:nil];
        }
        else {
            [self performSelectorOnMainThread:@selector(close)
                                   withObject:nil
                               waitUntilDone:YES];
        }
    }
    

    Rather than doing the performSelectorOnMainThread from your block, this will ensure that anytime it’s called you’ll be on main.

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

Sidebar

Related Questions

I have a ViewController that includes its own .nib file, I am wanting to
I have a ViewController that has its own NIB. I would like to embed
I have a viewController that autorotates just fine, The problem is that is I
i have more viewcontroller that start from rootviewcontroller. So for example i start with
I want to have a ViewController that has a table view on the top
I have created two viewController classes such that one is superclass of another.i have
I have implemented a Pin-Lock viewController such that every time app becomes active, the
I have just noticed that my ViewController does not call init (See below) when
I have a class that is viewcontroller and I'v putted it inside of tabbar.
I have a UITabBarController that adds a viewController, but the positioning is off. There

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.