zoukankan      html  css  js  c++  java
  • ios NSString crash

    Recently encountered an exception, and solved a bit.

    exception description:

    Application Specific Information:
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFString rangeOfString:options:range:locale:]: nil argument' terminating with uncaught exception of type NSException abort() called

    First we look at the wrong reason, and then the corresponding code to find where it will go wrong, view the description of the method.
    Solution:
    NSString method "containsString:"
    Declaration
    -(BOOL)containsString:(NSString *)str;
    Parameters
    str -> The string to search for. This value must not be nil.
    Return Value -> YES if the receiver contains str, otherwise NO.

    成功的三大原则: 1、坚持 2、不要脸 3、坚持不要脸
  • 相关阅读:
    1
    webpack
    webpack32
    41324
    124
    CSS 32
    Git 分支管理
    Git 标签管理
    datetime的timedelta对象
    unittest中的testCase执行顺序
  • 原文地址:https://www.cnblogs.com/xulinmei/p/7421297.html
Copyright © 2011-2022 走看看