Nswarn: nil string argument libc ++ abi. dylib: terminate_handler unexpectedly threw an exception, exceptionhandler

Source: Internet
Author: User

Nswarn: nil string argument libc ++ abi. dylib: terminate_handler unexpectedly threw an exception, exceptionhandler

Yes

20:12:51. 501 Pan doctor [5001: 299704] nssag: nil string argument

20:12:51. 502 Pan doctor [5001: 299704] nssag: nil string argument

Libc ++ abi. dylib: terminate_handler unexpectedly threw an exception


Summary of error messages:

I couldn't find a good method when this error occurs, but then I found out:

It turns out that the NSString type variable I uploaded is empty. It turns out that I used a local variable in the code block. As a result, when I exit the code block, the memory is destroyed,

The memory is empty.

Solution:


1. Avoid using NSString * string = string2;

2. Avoid using NSString * string1 = [NSString stringWithFormat: @ ""];

3. In the code block, consider whether the memory is destroyed in advance:

For variables: it is best to use:

NSString * string1 = [NSString alloc] initWithFormat: @ "% @", string2];

Format

// The above is my opinion. please correct me if you have any questions. Thank you. --- Xiaohongqi

QQ-651134397

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.