Why does the application crash when the user starts it, but does not use xcode to open it?

Source: Internet
Author: User

Why does the application crash when the user starts it, but does not use xcode to open it?

 

The iPhone system uses a watchdog timer when the program starts. Once it finds that the program takes too long to initialize the Startup Program, the system will terminate the program. The Program terminated Exception Code is 0x8badf00d, and a crash report is output.

 

Exception Type: 00000020

Exception Codes: 0x8badf00d

Highlighted Thread: 0

 

Application Specific Information:

Com. yourcompany. yourapp failed to launch in time

Elapsed total CPU time (seconds): 11.120 (user 1.840, system 9.280), 59% CPU

Elapsed application CPU time (seconds): 2.160, 12% CPU

 

 

When xcode starts the program, the watchdog timer will expire because xcode fails to attach to the debugger, causing you to fail to notice the long start time.

Of course, the simulator configuration is relatively high and may not cause any problems.

 

You should minimize the startup time of the application. If some things must be completed at startup, you should use the sub-thread and have a good interface prompt.

 

I personally suggest that you should not initialize the network response in init because of network uncertainty. If the network does not return or exceeds the time limit, the program will also be terminated.

It is unwise to perform network operations in sub-threads at the same time.

 

Refer:

Https://developer.apple.com/devcenter/ios/index.action

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.