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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:48:24+00:00 2026-06-13T07:48:24+00:00

I got a UITabBarController created programmatically in my AppDelegate. I also created two UINavigationController

  • 0

I got a UITabBarController created programmatically in my AppDelegate. I also created two UINavigationController with some UIViewControllers inside them. I added the navigation controller onto the UITabBarController, like this:

    BVMapViewController *mapViewController = [[[BVMapViewController alloc] initWithNibName:@"BVMapViewController_iPhone" bundle:nil] autorelease];
    BVFavoritesViewController *favoritesViewController = [[[BVFavoritesViewController alloc] initWithNibName:@"BVFavoritesViewController_iPhone" bundle:nil] autorelease];

    UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:mapViewController] autorelease];
    [navigationController setToolbarHidden:YES];
    UINavigationController *navigationControllerForFavorites = [[[UINavigationController alloc] initWithRootViewController:favoritesViewController] autorelease];

    self.tabBarController = [[[UITabBarController alloc] init] autorelease];
    NSArray* controllers = [NSArray arrayWithObjects:navigationController, navigationControllerForFavorites, nil];
    self.tabBarController.viewControllers = controllers;
    [self.window setRootViewController:self.tabBarController];

The result works properly creating a tab bar controller with two navigation controllers.

The problem is as follows:
The first UINavigationController contains a UIViewController with a MKMapView inside it. That map shows a bunch of POIs so when you tap on one of them, the app sends a request to a webservice (in the background) which as soon as it finishes it informs the view controller which pushes another UIViewController into the navigation stack to show some more information about that POI,

[self.navigationController pushViewController:self.stationViewController
                                     animated:YES];

Here I get the following error:

_WebTryThreadLock(bool), 0x11d9b560: 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 0x58a76a9 WebThreadLock
2 0x5bfdfe -[UITextView _updateForNewSize:withOldSize:]
3 0x5c00b4 -[UITextView setFrame:]
4 0x4c59df UIViewCommonInitWithFrame
5 0x4c5bae -[UIView initWithCoder:]
6 0x4d9fb7 -[UIScrollView initWithCoder:]
7 0x5bc851 -[UITextView initWithCoder:]
8 0x7b1a02 UINibDecoderDecodeObjectForValue
9 0x7b10e5 -[UINibDecoder decodeObjectForKey:]
10 0x6a2648 -[UIRuntimeConnection initWithCoder:]
11 0x7b1a02 UINibDecoderDecodeObjectForValue
12 0x7b1418 UINibDecoderDecodeObjectForValue
13 0x7b10e5 -[UINibDecoder decodeObjectForKey:]
14 0x6a1aa3 -[UINib instantiateWithOwner:options:]
15 0x566e37 -[UIViewController _loadViewFromNibNamed:bundle:]
16 0x567418 -[UIViewController loadView]
17 0x567648 -[UIViewController loadViewIfRequired]
18 0x567882 -[UIViewController view]
19 0x567b2a -[UIViewController contentScrollView]
20 0x57eef5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:]
21 0x57efdb -[UINavigationController _layoutViewController:]
22 0x57f286 -[UINavigationController _updateScrollViewFromViewController:toViewController:]
23 0x57f381 -[UINavigationController _startTransition:fromViewController:toViewController:]
24 0x57feab -[UINavigationController startDeferredTransitionIfNeeded:]
25 0x5804a3 -[UINavigationController pushViewController:transition:forceImmediate:]
26 0x580098 -[UINavigationController pushViewController:animated:]
27 0x386f -[BVMapViewController parserDidFinishWithStation:]
28 0x785c -[BVParser parseStation:]
29 0xf8a0d5 -[NSThread main]
30 0xf8a034 NSThread
_main
31 0x94e53ed9 _pthread_start

I tried to perform this on the main thread but the pushed controller gets its view all black.

Thank you in advance and have a good day.

  • 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-13T07:48:25+00:00Added an answer on June 13, 2026 at 7:48 am

    Well, as you alluded to in your question, you must push the view controller on the main thread. Any interaction with UIKit must be done on the main thread.

    As to why it shows up black, that is a different issue which you need to resolve by standard troubleshooting techniques. Once it is on the main thread and it is running correctly, set breakpoints on the various methods of the class being displayed (viewDidLoad, etc) and see where it is tripping up.

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

Sidebar

Related Questions

I got a UITabBarController and one of the bar items is a Navigation Controller
I've got a UIWebView inside a UINavigationController in a UITabBarController. Sometimes the pages displayed
I'm currently playing with UISplitView Controller as I've got to have some of them
Ok so I actually got to add UINavigationBar inside a UITabBarController using the following
I'm using Storyboard first time, and I've created UITabBarController application. I've got 4 UINavigationControllers
I've got a UITabBarController in my project that I'm creating programmatically - without a
I've got a UITabBarController which contains a UINavigationController . Within the visible UIViewController ,
I've got an app with a UITabBarController that controls several UIViewControllers . Within that
I've got my View hierarchy set up like this. UITabBarController | UINavigationController | |
i have a problem is i got UItabbarController it contain 3 Tabbars each tabbar

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.