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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:53:11+00:00 2026-05-27T07:53:11+00:00

I have made changes to the database in the next version of my app.

  • 0

I have made changes to the database in the next version of my app.

From the the end of the main view controller’s viewDidLoad, I call a method that checks to see if the database is up to date. If it isn’t a UIActivityIndicatorView is displayed while the database is repaired (takes 5-10 seconds).

That part goes like this:

[self.view addSubview: activityView];

//repair database
...
//done

[activityView removeFromSuperview];

I want the app to load, the UIActivityIndicatorView to display, fix the database, close the UIActivityIndicatorView.

The problem is that this all happens during the loading screen (default.png).

I added some logging to see when the activityView is called, when the database is being updated, etc., and can confirm that all of this is logged during the loading screen.

What should I do to solve this problem?

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

    The problem is you’re trying to do all this work on the main thread. The UI doesn’t actually update until control returns to the runloop. Instead you need to display the activity indicator, then schedule your database work to be done on a background thread. Make sure UI input is disabled during this time. Once the work is complete, then you can call back to the main thread, remove the activity indicator, and enable UI interaction.

    Note that if you do this, you need to make sure your database work is done in a manner that’s safe to occur on a background thread (e.g. if you’re using CoreData, your background thread needs its own context, etc.)

    Also note that if you decide not to do this and instead just live with the default.png displaying, your app will actually end up being terminated if it takes longer than 5-10 seconds to do this work, and the user will never be able to successfully launch it.

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

Sidebar

Related Questions

I have a main branch with a file called app.js . I made changes
I have a ASP.net 2.0 app and I have made some changes the the
I have made some changes in one perforce client, but haven't submitted them. I
I've just create a new MVC project, and have made no changes at all,
I have a trigger that stores changes made in a separate table when a
I have a Django-project which was running fine, until I made some changes I
I have a template I made that sets variables that rarely change, call my
I have a weekly script that moves data from our live database and puts
How do I see what pending changes have been made to an SPFILE before
I want to integrate apache-Cassandra as my Database. I have downloaded 0.8.2 version of

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.