IOS empty string Error resolution

Source: Internet
Author: User

NSScanner: nil string argument  NSScanner: nil string argument libc++abi.dylib: terminate_handler unexpectedly threw an exception

Most of this error is caused by an empty string, please check carefully, no, just look at the following several methods.

Use the [array objectatindex:i] method for an empty array, and this error is not a datagram group out of bounds, the good OC supports passing data to an empty object?

A Nsarray, Nsdictionary object is assigned to a Nsmutablearray, Nsmutabledictionary object, and then the object is delete, add, set and other modifications, may also report this error.

When using storyboard\nib to build the interface, there is no corresponding control in the code, but the control is already connected to the sb\nib, and the same error is reported, and most appear when the page jumps, as shown in.

Sao years, sometimes even warning will not have, to look carefully, this error is actually quite annoying, so you should always do not connect the line off (storyboard\nib and code to synchronize control variables).

the integration of friends can also be a mistake, go to the official website to see, anyway, I have not met. using R euseidentifier in UITableView, the wrong ID can also cause this error.

When using a third-party framework, this problem also occurs, the common is to refresh the incompatibility between the controls, so to carefully observe, in fact, I was the pit of a bit miserable.

When the breakpoint is difficult to locate the error, please use the following code, may be able to give you a hint:

@try {    // where the program crashes, in fact this error is often reported in main.c file }@catch(nsexception *  Exception) {    NSLog (@ "exception:\n%@", exception);} @finally {}

IOS empty string Error resolution

Related Article

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.