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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:30:33+00:00 2026-05-26T11:30:33+00:00

I am updating a rather straightforward iPhone app that requires an initial data load

  • 0

I am updating a rather straightforward iPhone app that requires an initial data load into a SQLite databbase upon initial setup. I am using the DSActivityView class to provide a nice “Please wait” message. The entire data load takes about 15 seconds on WiFi and about 30-45 seconds on 3G.

This whole process originates in the application:didFinishLaunchingWithOptions method of my app delegate.

The data load procedures are being launched in a separate thread by creating an instance of an NSOperation object called UpdateTable for each of the 8 tables. Each operation is placed in an NSOperationQueue, and then released. The data loading works like a champ.

What is NOT working like a champ; however, is the replacement of the “Please wait..” view with the main navigation controller view.

The first approach was to instantiate an NSInvocationOperation that called a method in my app delegate that to execute the following:

- (void) loadNavController;
{
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    [defaultImageView removeFromSuperview];

    [DSBezelActivityView removeViewAnimated:YES];
}

This operation was added to the queue after the last UpdateTable operation was added.

The reason this approach is buggy is because the NSInvocationOperation runs concurrent with the other processes in the thread; therefore, the method shown above fires before the last table update can be performed.

So I tried the following approach:

In my UpdateTable.m (where all of the JSON and SQLite is taking place), I entered the following line to execute immediately after the last table update completed:

[appDelegate performSelectorOnMainThread:@selector(loadNavController) withObject:nil waitUntilDone:NO];

This approach got the timing right, however, the main UNavigationController and UIWindow objects were both nil with loadNavController executed. Setting some debug breaks, I noticed that the delloc method of my app delegate was firing prior to the loadNavController method was executed. Both objects are assigned to the MainWindow via IBOutlets that are set up as IBOutlets (nonatomic, retain) in the App Delegate. I haven’t a clue as to why the dealloc is firing, as this process is taking less than 10 seconds in total.

Any assistance you might render would be greatly appreciated. Many thanks in advance.

VB

  • 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-26T11:30:34+00:00Added an answer on May 26, 2026 at 11:30 am

    A quick note to update this thread with the solution.

    The performSelectorOnMainThread approach turned out to be correct. The reason the navController object was nil when the selector was called was due to me creating a new instance of the app delegate:

    AppDelegate *appDelegate = [AppDelegate alloc] init];
    

    instead of referencing the existing object:

    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    

    Works like a charm.

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

Sidebar

Related Questions

When updating the managedObjectContext is it ok practice to do the save setup in
I am currently updating a few settings in a rather large *.exe.config file via
I have noticed that when updating my web content files (in this case, a
I'm making an App Engine site that I don't want to be nationwide, but
My page is currently updating an existing xml, the problem is that when it
hi im recurringly updating this map and i noticed its acumulating items rather than
I will be storing an array in session that will contain data entered by
Does solr allow updating specific field rather than indexing entire document. I know solr
Background I have a large number of fields that will be updating real time
I'm in the process of updating a Rails 3 app to use Rails 3.1

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.