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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:54:44+00:00 2026-06-11T13:54:44+00:00

I have a UINavigationController in my application where I am pushing a view controller.

  • 0

I have a UINavigationController in my application where I am pushing a view controller. On that viewcontroller, there is a preloader view that shows animation while the data is being downloaded and parsed in the background. Below the animation is a button that should redirect the user to some other view controller.

Now, I can accomplish this by popping the viewcontroller since the view I need to be directed to is the view the current view was pushed from. The problem here, however, is that the downloading, parsing, timer, etc.. everything keeps happening in the background.

The functionality I need is for the viewcontroller to completely stop working as soon as I pop the VC by clicking on the button.

Thanks in advance.

  • 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-11T13:54:45+00:00Added an answer on June 11, 2026 at 1:54 pm

    What are you using to run the background operations?

    You can simplify background operations by subclassing NSOperation and using NSOperationQueue to run it. You just have to release NSOperationQueue and iOS will clean up for you automatically.

    https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html

    https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html

    Here is an example.

    @interface MyBackgroundOperation : NSOperation
    @end
    
    @implementation MyBackgroundOperation
    - (id)init
    {
        self = [super init];
    
        if(self != nil)
        {        
            // stuff that needs to be done at init
        }
    
        return self;
    }
    
    - (void)main
    {
        @try
        {
            // run my background operations
        }
        @catch (NSException *e)
        {
            // catch the exception
        }
    }
    
    - (void)dealloc
    {
        // clean up
        [super dealloc];
    }
    @end
    

    Then you start the operation like this

    NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init];
    
    MyBackgroundOperation *myOperation = [[MyBackgroundOperation alloc] init];
    [operationQueue addOperation:myOperation];
    [myOperation release];
    
    [operationQueue release];
    

    The OS will retain the operation until it’s finished so that releasing the view controller will not effect it. However, if you want to stop the operation after it’s already started you’re going to have to use a bit more fancy techniques, maybe notifications or KVO.

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

Sidebar

Related Questions

I have a small problem with UINavigationController animation between two view. My application build
I have a UINavigationController that pushes a view controller 3 levels down. I am
I have a Navigation application that has a view controller in it.. I am
I currently have a UINavigationController based application that works just fine. I'd like to
I have a UITabBar + UINavigationController application which often needs data from the internet.
This is the structure of my application currently: UIWindow UIViewController (Root View Controller) UINavigationController
Ok I have an application that uses tab controller. However before I want the
I have a application that make use of a UINavigationController. In the rootview I
In the application I'm trying to develop I have UINavigationController as a root controller.
I have an application that is based on a UINavigationController; I wish to add

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.