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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:29:44+00:00 2026-05-29T07:29:44+00:00

NSString *url = @http://localhost/xml; NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; [NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc]

  • 0
NSString *url = @"http://localhost/xml";
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];

[NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){
    NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLData:data error:&error];
    int count = [[[xmlDictionary objectForKey:@"ArrayOfMessage"] objectForKey:@"Message"] count];
    if(true && count > 5) count = 5;

    UIScrollView *sv = [[UIScrollView alloc] initWithFrame:CGRectMake(58, 0, MESSAGE_PAGING_WIDTH, 493)];
    [sv setBounces:YES];
    [sv setClipsToBounds:NO];
    [sv setPagingEnabled:YES];
    [sv setShowsHorizontalScrollIndicator:FALSE];
    [sv setContentSize:CGSizeMake(count * MESSAGE_PAGING_WIDTH, frame.size.height)];

    int i = 0;
    while (i < count) {
        NSDictionary *data = [[[xmlDictionary objectForKey:@"ArrayOfMessage"] objectForKey:@"Message"] objectAtIndex:i];
        [sv addSubview:[[MessageView alloc] initWithFrame:CGRectMake(i * MESSAGE_PAGING_WIDTH, 0, 838, 493) data:data]];

        ++i;
    }

    [self addSubview:sv];
}];

I get a crash message of:

bool _WebTryThreadLock(bool), 0x7d7d080: 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...

How can I remedy?

  • 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-29T07:29:45+00:00Added an answer on May 29, 2026 at 7:29 am

    You’re creating UIKit elements on a different thread than the main thread:

    This may be a result of calling to UIKit from a secondary thread.

    sendAsynchronousRequest:queue:completionHandler: performs on a background thread. Inside your block you need to use performSelectorOnMainThread:withObject:waitUntilDone: for UIKit objects.

    See http://blog.jayway.com/2010/03/30/performing-any-selector-on-the-main-thread/

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

Sidebar

Related Questions

NSURL *url = [NSURL URLWithString:@http://localhost/News]; NSString *jsonString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; NSLog(@%@, jsonString);
how to remove degrre symbol form this URL NSString *s= http://www.com/appfeed/default.php?app=1.31223 ° |103.865**°**|56a76d i
Given this XML structure from (http://localhost:3000/route.xml): <objects type=array> <object> <trip0> <departure>20:01</departure> <start>Place a</start> <end>Place
How can I concatenate an NSString URL? For example: http://isomewebsite.com/username=[someuservariable]&password=[somevariable]
NSString * url; NSString * device; NSString * API; API = @http://www.test/; device =
NSString *url = @http://stackoverflow.com/questions/ask; How can I get the character position of the 4th
I'm having a problem with this: -(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u { I'm
I want to check if an NSString is a valid URL so I can
Is their a method to encode/decode HTML and URL (in Xcode, using Objective-C)? [NSString
NSString *latitude = [[NSString alloc] initWithFormat:@%g°, coordinate.latitude]; NSString *longitude = [[NSString alloc] initWithFormat:@%g°, coordinate.longitude];

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.