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

相關文章
相關標籤/搜索