1.nil passed to a Callee that requires a non-null 1st parameter

会有一个警告: nil passed to a callee that requires a non-null argument,意思是commandStr形参不能传nil。
根据上下意思,commandStr如果没值也是传出空字符串处理,改成如下即可:

2.Although the value stored to 'weekIntValue' is used in the enclosing expression, the value is never actually read from 'weekIntValue'

尽管在表达式中使用了存储在“ weekIntValue”中的值,但实际上从未从“ weekIntValue”中读取该值,根据翻译意思将表达式拆开再返回weekIntValue的值,可修改为:

3.warning:the left operand of == is a garbage value
当出现这个警告(内存泄露)的时候,是由于你左边的变量在不满足上面if的条件的时候,没有给 ==左边的变量赋值,会造成这样的警告。解决办法是:可以将==左边的变量初始化一个值,或者保证 在进行if判断的时候一定有值。
网友评论