debugging “failed to launch in time” with xcode

不羁的心 提交于 2019-12-24 12:03:43

问题


can someone help me setup my debug environment so things will make more sense?

at some point the simulator stopped loading an app i'm working on. the app loads well if i run it with instruments and works well on the device (iPad).

the application tries to load and all of a sudden i get a 'debugging terminated' message at the bottom left of xcode.

running 'tail -f /var/log/system.log' i found the following message: " myApp failed to launch in time".

poking around and experimenting with breakpoints, i was able to pin point the culprit to this method:

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

this method is part of the app delegate naturally, and the first thing it does is execute:

[window addSubview:viewController.view];

so my questions - how can i figure out what the hell is going on here and which part of my app is hanging?

moreover, what kind of setup can be used to get useful information from the debugger...

whenever there is an error, i cannot even figure out the line of code that generated it.

thanks.


回答1:


If your app failed to launch in time, means your app is doing something time consuming at launch time in this method

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

if you exceed a period of time and still not launched, your application automatically terminated. So you could review your codes and make some of them run in background after your app has finished launching. Cheers.



来源:https://stackoverflow.com/questions/4798248/debugging-failed-to-launch-in-time-with-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!