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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:26:37+00:00 2026-05-31T05:26:37+00:00

The application is made of navigation views. I am calling a function in viewDidAppear

  • 0

The application is made of navigation views.
I am calling a function in viewDidAppear which is

[self extractInfoWithWebsite:[NSString stringWithFormat:@"http://www.cineklik.com/%@-%@.aspx", self.cinemaType, self.location]];

This function does HTML parse from the a current webpage on the internet.
The code is kind of long to share but the idea is that it extract data from a website.

The problem is that I am having is that if the user decides to click the back button of the navigation before that the information is loaded, the page stays the same and the application stops functionning (not a crash but becomes static, doesn’t do anyth anymore).

Is there a solution to this?
Thank you in advance

EDIT:

I changed the code to the following:
NSOperationQueue *queue = [NSOperationQueue new];

    /* Create our NSInvocationOperation to call loadDataWithOperation, passing in nil */
    NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
                                                                            selector:@selector(extractInfoWithWebsite:)
                                                                              object:[NSString stringWithFormat:@"http://www.cineklik.com/%@-%@.aspx", self.cinemaType, self.location]];

    /* Add the operation to the queue */
    [queue addOperation:operation];
    [operation release];

Now I am able to press the back button without freezing, but now there is a crash with the following error:
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…
I think it s because my function was still running in the background.
How to solve this issue?

  • 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-31T05:26:38+00:00Added an answer on May 31, 2026 at 5:26 am

    I would look up NSOperation

    The standard approach inside an NSOperation is to check if they have been cancelled before doing heavy processing.

    Here is a good link to start your research from.

    EDIT: I thought I would clarify the cancelled part

    NSOperations have a main() and inside main() it is good practice to do something like

    NSData* chunkyReply = nil;
    
    if (!self.isCancelled) {
        chunkyReply = [NSURL stuff];
    }    
    
    
    if (!self.isCancelled) {
        //parse chunkyReply
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a windows application made in VB.NET which maintains a database, and i
I've been given a Flex application which made use of a RESTFUL service. I've
I made an application to navigate between views. Each view contains Different text. The
Android: I have a social networking application made by me, in which you can
I have an application which used top bar navigation and a MapView. On the
I made a swing application in which i have a grid layout on a
i created an iPad application, in which navigation is not working, for example on
I have made an iPad application, in that I used navigation control, now in
I'm building a fairly large enterprise application made in python that on its first
Somebody knows an example of this? an application made with JSF 2.0 and EJB

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.