IOS Crash Debug Exc_bad_access (code=1,address=0x10)

Source: Internet
Author: User

Today in the test process, found a problem, is the iOS 8 above the machine test no problem, in iOS 7 test is prone to crash, a straight line exc_bad_access (code=1,address=0x10), without a clue, to check the information, the steps are as follows:

1. Set up zombie objects to get more information

Result: Really get more information: Message sent to deallocated instance

2. And then search the information on the Internet, probably means that through the search has been released address, through the LLDB to find the release history of memory, in particular, refer to:

http://blog.csdn.net/fg313071405/article/details/17448425

But my because of the crash of the real machine, there is no specific memory release address on the computer.

3. Obviously this is because after a uiviewcontroller is released, some requests are made to this VC again. And according to log found that the VC is the implementation of the Dealloc method, which indicates that the VC may be set up xxx.delegate=self; When the VC released, this XX has not been released, so the callback method of XX still call delegate that is the VC here, so the crash occurred.

The workaround is to set xx.delegate = nil in the Dealloc, as a reference: http://blog.csdn.net/smking/article/details/43775523

Look carefully at the original

Self.navigationController.delegate = self; Because of this sentence.

Finally: Bug fixes

IOS Crash Debug Exc_bad_access (code=1,address=0x10)

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.