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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:22:04+00:00 2026-05-24T19:22:04+00:00

I have a tab bar application with three tabs. In my second tab view

  • 0

I have a tab bar application with three tabs. In my second tab view i have a UIProgressView. I have a NSTimer in my viewDidLoad method which calls a method which updates the progressView

progressTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(updateProgress) userInfo:nil repeats:YES];

All is fine so far.

I want to know how do i run the timer in the background throughout the lifecycle of the app, so that progressView is updated no matter which view the user is in. It will be great if you can show me with a code snippet.

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-05-24T19:22:05+00:00Added an answer on May 24, 2026 at 7:22 pm

    It’s not advisable to update UI elements from background threads. Also, it’s not advisable to modify UI elements of a view when the user is not in that view. You are using precious system resources.

    Better way is to update the ProgressBar as soon as that view becomes active…

    UPDATE: You can see here to know how to run a task in background thread. You could set up your NSTimer to start in the selector you specify there. But again, this kind of stuff could lead to some weird bugs. Better to avoid..

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

Sidebar

Related Questions

I'm working on an application with three tabs plus a small view in which
I have a tab bar application with a different view on each tab. Each
Here's the setup: I have a tab bar controller with two tabs. There is
I have a tab bar application that contains navigation views in 2 of its
I have a tab bar application and I want to display those views that
I have 2 tab items. In tab No.1 I have a control which corresponds
I have a huge tab separated file which I want to sort on its
I have an application where I have a TabBarController with 4 tabs init, When
I have a UIImagePickerController as one view in a TabBar setup. Is it possible
I have a Tab Control with multiple Tab Pages. I want to be able

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.