libc++abi.dylib: terminate_handler unexpectedly threw an exceptionc++
出現這個問題的緣由不少!spa
代碼以下: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
待續中.......exception