WARNING: Slow defaults access for key Internal took xx seconds, tolerance is 0.020000

797 views Asked by At

I have a weird problem with a phonegap iOS app. I have a version without adverts approved and working fine on the app store and a new version with adverts which has been rejected due to the app hanging on the splash screen.

The difference in the apps is 3 ad plugins, iAD, admob and revmob. The app works fine mostly but once every so often it will hang on the splash screen like the feedback from Apple suggests, I can't find what makes the problem occur.

The only clue I have is "WARNING: Slow defaults access for key Internal took 0.039977 seconds, tolerance is 0.020000" appearing in the error console but when this appears the app still runs fine.

Is this warning likely to relate to the hanging on splashscreen problem? Any ideas how to approach the problem or what to look for which might be causing it?

Thanks

1

There are 1 answers

1
Khalid Ibrahim On

I don`t think this is the reason and you are probably getting this on the simulator which is not as efficient as the device.

The reason for late launches 90% of the times is something that you do in your app delegate, more specifically in

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

Avoid doing lengthy tasks in there , like network connections or manipulating large data and if you still need to do something in there and can`t move it to your viewDidLoad method do it in another thread like so:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[self performSelectorInBackground:@selector(fetchUserInfoFromDB) withObject:nil];


return YES;
}

-(void)fetchUserInfoFromDB
{
//Do what you need to do in here
sleep(5);
NSLog(@"The app lanuched but I am still running in the background, Yay!!");

}

Best of luck