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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:05:21+00:00 2026-05-27T19:05:21+00:00

I am having a problem that I can’t seem to figure out. What I

  • 0

I am having a problem that I can’t seem to figure out.

What I have setup:

  1. A custom UITableViewCell that has multiple textfields in it. Similar to how Apple has it setup when adding a new address for someone in contacts.
  2. The table with the custom cell is being presented as a modal view. This table view also has other cells that are generic (i.e. not the custom cell stated in 1. ).
  3. The presented modal view has a toolbar at the top, which contains a done button. When done is pressed the modal view sends a call back to its delegate and dismisses.

The problem that I am having:
When the user selects a UITextField and starts to edit the UIKeyboard is presented (obviously right?). If the keyboard is open, and the user selects “done” on the toolbar (as stated in 3. ), the app crashes because the parent view is trying to dismiss the modal view (modal view containing the keyboard) while the keyboard is open.

High level it seems like it should work like this:

User clicks “done” in toolbar -> check if UIKeyboard is open -> if open, close else dismiss modal view

But it hasn’t been that easy.

I have been pulling my hair out trying to find a viable work around for this and nothings seems to work.

Any suggestions would be very appreciated.

Edit

Here is the crash log:

2011-12-22 16:03:09.021 Renshaw[2308:5f43] bool _WebTryThreadLock(bool), 0xad7a9e0: 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   _ZL17_WebTryThreadLockb
2   WebThreadLock
3   -[UITextRangeImpl isEmpty]
4   -[UITextRange(UITextSelectionAdditions) _isCaret]
5   -[UITextSelectionView setCaretBlinks:]
6   -[UIKeyboardImpl setCaretBlinks:]
7   -[UIKeyboardImpl setDelegate:force:]
8   -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
9   -[UIResponder _finishResignFirstResponder]
10  -[UIResponder resignFirstResponder]
11  -[UITextField resignFirstResponder]
12  -[UIView(UITextField) endEditing:]
13  -[UIWindowController _prepareKeyboardForTransition:fromView:]
14  -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:]
15  -[UIViewController _dismissViewControllerWithTransition:from:completion:]
16  -[UIViewController dismissViewControllerWithTransition:completion:]
17  -[UIViewController dismissViewControllerWithTransition:completion:]
18  -[ListingsViewController postSearch:allObjects:constrainedList:]
19  -[FilterViewController searchObjects]
20  -[NSObject performSelector:withObject:]
21  -[MBProgressHUD launchExecution]
22  -[NSThread main]
23  __NSThread__main__
24  _pthread_start
25  thread_start
[Switching to process 10499 thread 0x2903]
[Switching to process 10499 thread 0x2903]
  • 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-27T19:05:21+00:00Added an answer on May 27, 2026 at 7:05 pm

    The clue is in the stack trace:

    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...
    

    You’re calling a UIKit method from a secondary thread. You must be doing something on not-the-main-thread such as calling resignFirstResponder. See here for more information on that:

    • https://stackoverflow.com/a/6300574/1068248

    Update:

    It turns out the solution was to use something along the lines of:

    dispatch_async(dispatch_get_main_queue(), ^{ <code_here> });
    

    to wrap the call to dismiss the view so that the UIKit methods were being run on the main thread.

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

Sidebar

Related Questions

I am having a problem that I just can't seem to figure out. The
I'm having a slight problem that I can't figure out, but should be really
I'm having a strange problem that I can't figure out that popped up when
I'm having a strange problem that I can't work out and wonder if anybody
I have been having a small problem that I can't by-pass it, I keep
I'm having a very odd problem that I can't seem to track down. Any
I'm having a problem with my Seam code and I can't seem to figure
I'm having a problem that I can't sort it out. Please take a look
HI Guys, Here I am having problem that How can I post an image
Here's the problem I'm having, I've got a set of logs that can grow

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.