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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:55:12+00:00 2026-05-14T02:55:12+00:00

I am developing an app in which I have a table. In the table

  • 0

I am developing an app in which I have a table. In the table cell I have an imageview ( the images are displayed via url ) and a textview/webview. I start threads for each row to get the images in the

- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

method ( if image is not already got ) and set the text of textview/webview from an array.

The problem arises when the images are being received and I pop the view, the application crashes giving the following message:

bool _WebTryThreadLock(bool), 0x1a0670: 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…

Now the situation becomes more weird if I don’t release the textview/webview that I added to the cell, then every thing works fine.

Edit: the crash does not happens when I replace textview/webview with a label

Hoping I am clear in my question. If any thing is confusing please comment. I need to resolve this.

Thanks,

Nikhil

  • 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-14T02:55:12+00:00Added an answer on May 14, 2026 at 2:55 am

    That’s a huge mistake to use threads. Try to avoid using threads if you have other solutions !

    In your case, just use an asynchronous NSURLConnection which will take care of downloading your image while not slowing your app 😉

    Here is part of the code :

    - (void) startDownload {
        self.activeDownload = [NSMutableData data];
    
        NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:
                                 [NSURLRequest requestWithURL:
                                  [NSURL URLWithString:@"blablabla"]] delegate:self];
        self.imageConnection = conn;
        [conn release];
    }
    
    #pragma mark -
    #pragma mark Download support (NSURLConnectionDelegate)
    
    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
        [self.activeDownload appendData:data];
    }
    
    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
    {
        NSLog(@"ERROR DOWNLOADING");
        // Clear the activeDownload property to allow later attempts
        self.activeDownload = nil;
    
        // Release the connection now that it's finished
        self.imageConnection = nil;
    }
    
    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSLog(@"FINISH DOWNLOAD");
    
        UIImage *image = [[UIImage alloc] initWithData:self.activeDownload];
        self.activeDownload = nil;
        self.imageConnection = nil;
    
        //do whatever you want with your image
    
        [image release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an app which allows users to color the images. I have
We have been developing a DB web app which constantly queries an SQL store
I have been developing an iPhone app which queries a server that relays data
currently we are developing an app in which we use database table to store
I am developing an app in android, which basically visits a given url and
I am developing an app in which I have to delete the contacts from
I am developing a app in which i have rotate a delete button when
I'm developing a calendar app. It stores times in two formats. The table have
I am developing an android app in which I have to collect date of
I am developing a web app which requires a username and password to be

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.