开发者

Comparison between pointer and integer?

开发者 https://www.devze.com 2023-03-26 15:07 出处:网络
How would I fix this warning in this if statement? if ((NSUInt == nil) || (myInt == nil)) { NSUInt = 0;

How would I fix this warning in this if statement?

if ((NSUInt == nil) || (myInt == nil)) {
    NSUInt = 0;
    myInt = 0;
}

I get comparison between pointer and intege开发者_JAVA技巧r.

Thanks!

Edit: This seemed to fix it:

if ((!NSUInt) || (!myInt)) {
    NSUInt = 0;
    myInt = 0;
}


Then don't compare pointers and integers:

myInt == 0

(I'm guessing that myInt is an integer, but I don't know what NSUInt is.)


did you try simple !myInt instead of myInt==nil and !NSUInt instead of == 0?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号