libc++abi.dylib: terminate_handler unexpectedly th

libc++abi.dylib: terminate_handler unexpectedly threw an exceptionc++

出现这个问题的缘由不少!spa

缘由1:

代码以下:code

NSRange range = [key rangeOfString:@"value"];

    if (NSNotFound != range.location) {

        NSString *calString = [key substringFromIndex:(range.location + range.length)];

........

......

说明:string

崩溃在第三行substringFromIndex,由于 range.location未取到值,而未加第二行 if (NSNotFound != range.location)   判断,因此substringFromIndex出崩溃。io

 

缘由2:

待续中.......exception

相关文章
相关标签/搜索