好吧,睡了一觉起来,发现同样的问题在爆栈上已经有大神回复我了,我就贴在这里好了……在爆栈上我问的是为啥他要用地址去和NULL比较,然后被人修改为了为何要用常量的地址去和NULL比较?因为那个UIKey.....确实是常量 好下面是我认为解决我问题的回复“Comparing the address of a constant (or function) to null is generally used to determine if the constant is defined.
You're getting the warning because the SDK that you're building against (minimum target version) has the constant defined, so it will always evaluate to true (the address won't be null). However, when run on a version of iOS that doesn't have the constant defined, it will not be true (the address will be null).
If you lowered the target version to a version below where the constant were defined, it would weakly link to that SDK, and you would no longer receive the warning.”
好吧,睡了一觉起来,发现同样的问题在爆栈上已经有大神回复我了,我就贴在这里好了……在爆栈上我问的是为啥他要用地址去和NULL比较,然后被人修改为了为何要用常量的地址去和NULL比较?因为那个UIKey.....确实是常量
好下面是我认为解决我问题的回复“Comparing the address of a constant (or function) to null is generally used to determine if the constant is defined.
You're getting the warning because the SDK that you're building against (minimum target version) has the constant defined, so it will always evaluate to true (the address won't be null). However, when run on a version of iOS that doesn't have the constant defined, it will not be true (the address will be null).
If you lowered the target version to a version below where the constant were defined, it would weakly link to that SDK, and you would no longer receive the warning.”