- Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFString rangeOfString:options:range:locale:]: nil argument'
solution:
情形一:str 不能为nil, 需进行判空处理,否则当str == nil,是就会crash, 注意containsString 是iOS8中才出现的API,所以在小于iOS8的系统中运行也将导致程序崩溃
NSString method "containsString:"
/// str must not be nil.
-(BOOL)containsString:(NSString *)str;
情形二:searchString 不能为nil, 需进行判空处理,否则当searchString == nil,是就会crash,
NSString method "rangeOfString:"
/// searchString must not be nil.
- (NSRange)rangeOfString:(NSString *)searchString;