App stuck in splash screen on iOS 9 with no error

My app gets stuck on splash screen in iOS 9 both on iPhone and simulator. I can run it on iOS 8 or lower on device and simulator with no problem. My colleague working on the same app has exactly the same problem.

There is no error or anything, just hangs on splash screen. If I stop it on xcode and try to run it from the phone or simulator directly, it would run without any problem.

  • iPhone - finalizing Apple's vague “VerificationController.m”
  • Swift : Use closure compatible with Objective-C block
  • Displaying different app name in App Store and on home screen
  • Objective-C Declare vars with ({ … })
  • Segue programatically from custom tableView inside collectionView
  • How to Minimize App Store Approval Time
  • By the way, I don’t see didFinishLaunchingWithOptions or willFinishLaunchingWithOptions getting called!

    enter image description here

    4 Solutions Collect From Internet About “App stuck in splash screen on iOS 9 with no error”

    In your “answer” you include the code:

    +(void)initialize
    {
    
       titles = @[NSLocalizedString(@"CODE", nil), NSLocalizedString(@"ERROR", nil), NSLocalizedString(@"TROUBLESHOOTING", nil)];
    }
    

    This is indeed the source of your issue. It’s wise to be very careful when implementing +load or +initialize. @bbum has a great article on exactly that topic.

    +initialize is invoked the first time the class (or category) is touched – when the class is initialized +initialize is called by the class loading mechanism. There is no guarantee of when in the class loading process this may happen, which is part of your problem.

    In your case you are using NSLocalizedString – which under the hood can be fairly heavy. It has dependancies on several other classes (NSString, etc) and can potentially access the file system. As @bbum points out in his article, that can lead to serious trouble. In your case, this may be a nasty deadlock.

    Move your titles = @[NSLocalizedString... line to a more appropriate place in your object, like an initializer, awakeAfterUsingCoder:, etc. and your immediate problem should be solved. After doing so you should check your entire codebase for instances where +initialize and +load are implemented and audit them to make sure those uses are in line with @bbum ‘s recommendations.

    OK I found the problem. It sounds ridicules though!!

    I am using UITabBarController and inside the first controller I have a UITableViewController with a customised datasource class which would initiate a hard code table header and these headers are localised!!

     +(void)initialize
    {
    
       titles = @[NSLocalizedString(@"CODE", nil), NSLocalizedString(@"ERROR", nil), NSLocalizedString(@"TROUBLESHOOTING", nil)];
    }
    

    After I traced the stacks, I realised the process gets stuck right there with no trace and error! I still don’t know why!

    So I came up with a workaround:

     +(void)initialize
    {
    
         titles = @[@"Code",@"Error",@"Troubleshooting"];
    
    }
    

    And only retrieve the localised value when returning the text:

     -(NSString *)titleAt:(NSInteger)index
     {
         return NSLocalizedString(titles[index],nil);
     }
    

    Ok, I think I found the answer.

    You have to specify arm64 in all “Valid Architectures”.
    If you don’t specify arm64 or forget one the app won’t start and stays on the splashscreen.

    Just verified this.

    Is this an XCode 7 bug?

    I have both debug and release set to NO
    You sure “any SDK” also has arm64?