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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:21:58+00:00 2026-05-26T01:21:58+00:00

I am getting this error message (and subsequent crash) in Xcode organiser that I

  • 0

I am getting this error message (and subsequent crash) in Xcode organiser that I suspect is related to a Core Data migration that takes too long to complete:

Oct 4 09:51:14 unknown SpringBoard[30] : appName failed to launch in time

This migration works find in the simulator, even when I insert artificial delays (using sleep(100), for example).

It is only when I try to test on an iPhone 4 or iPod 4th generation that I am getting this timeout error message.

If a migration is not needed, by providing the correct sqlite3 database version during the build, there is no crash.

Here is what is happening, in code:

In the application delegate :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    PropertiesTableViewController *propertiesTableViewController = 
            [[PropertiesTableViewController alloc] initWithManagedObjectContext:self.managedObjectContext];

    UINavigationController *newNavController = 
                        [[UINavigationController alloc] 
                         initWithRootViewController:propertiesTableViewController];


    [propertiesTableViewController release];
    [window addSubview:newNavController.view];


    NSLog(@"UUID: %@", [[UIDevice currentDevice] uniqueIdentifier]);

    [window makeKeyAndVisible];

    return YES;
}


- (NSManagedObjectContext *) managedObjectContext {

    if (managedObjectContext != nil) {
        return managedObjectContext;
    }

    NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
    if (coordinator != nil) {
        managedObjectContext = [[NSManagedObjectContext alloc] init];
        [managedObjectContext setPersistentStoreCoordinator: coordinator];
    }
    return managedObjectContext;
}`

The persistentStoreCoordinator is a fairly long method, happy to provide it if needed. It migrates two databases, around 500kBytes each. The first always succeeds but the second one always fails (on the device), however both always succeed in the simulator. The propertiesTableViewController present a table view with the data it gets from the migrated database, so migration has to happen before propertiesTableViewController comes to view.

I have also tried trying to trigger the migration from inside the propertiesTableViewController (in the viewDidLoad method) using:

  • [NSThread detachNewThreadSelector:@selector(getMOC) toTarget:self withObject:nil] –> crashes as the table view can’t access the managed object context which is not ready since migration is still underway.
  • [self performSelectorOnMainThread:@selector(getMOC) withObject:nil waitUntilDone:YES]; –> Crashes with the same timeout error

The getMOC method is this:

-(void)getMOC
{
    NSAutoreleasePool *autoreleasePoolProperty = [[NSAutoreleasePool alloc] init];
    NSLog(@"getting appDelegate from PropertiesTableViewController");

    iNspectorAppDelegate *appDelegate = (iNspectorAppDelegate *)[[UIApplication sharedApplication] delegate];
    NSLog(@"getting managedObjectContext from PropertiesTableViewController");    
    self.managedObjectContext = [appDelegate managedObjectContext];
    NSLog(@"got managedObjectContext from PropertiesTableViewController");   
    [autoreleasePoolProperty release];  
    [self performSelectorOnMainThread:@selector(finishedGettingPropertyData) withObject:nil waitUntilDone:NO];
}
  • 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-26T01:21:58+00:00Added an answer on May 26, 2026 at 1:21 am

    I think you need to defer showing the navigation controller until migration is complete, i.e. you might need to display a “progress controller”.

    The easiest way is probably to display the progress controller at startup:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
    {
      ...
      [window addSubview:progressController.view];
      [window makeKeyAndVisible];
      [self performSelectorInBackground:@selector(loadPersistentStore) withObject:nil];
    }
    
    -(void)loadPersistentStore
    {
      [self persistentStoreCoordinator];
      [self performSelectorOnMainThread:@selector(persistentStoreLoaded) withObject:nil waitUntilDone:NO];`
    }
    
    -(void)persistentStoreLoaded
    {
      [progressController.view removeFromSuperview];
      self.progressController = nil;
    
      // Load the normal VC here
      ...
    }
    

    A slightly better option is to first try loading the persistent stores with NSMigratePersistentStoresAutomaticallyOption turned off. If that fails, then display the progress VC and try again in the background; if it succeeds then you can display the normal VC directly (In the code above, you could just call -persistentStoreLoaded directly from -application:didFinishLaunchingWithOptions:).

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

Sidebar

Related Questions

I'm getting this error message on all projects (including brand new empty templates) I'm
I'm getting this error message whiile running a Webservice I'm working on. it builds,
I'm getting this error message with the code below: class Money { public: Money(float
This error message is driving me nuts. I'm getting it when using Html.ListBox and
I'm getting this error message ... The Maximum string content length quota (8192) has
I'm getting this error: Compiler Error Message: CS0118: 'Configuration' is a 'namespace' but is
I'm getting this error message from git.What's this mean ? How to fix?
I have been getting this error message when I step into some methods Do
Im getting this error message randomly: Index was outside the bounds of the array.
I'm getting this error message: Notice: Undefined offset: 1 in C:\xampp\htdocs\evantechbd\secure\content\right_cat_pr.php on line 18

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.