iPhone NSInteger问题 [英] iphone NSInteger issues

查看:47
本文介绍了iPhone NSInteger问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎很基础,但是由于某些原因我无法使其正常工作-这两个变量都定义为NSIntegers:

This seems so basic but for some reason I can't get it to work - the 2 variables are both defined as NSIntegers:

if ([AScore == "100"] && [BScore == "100"]) {
       ...
}

那是行不通的-当我删除括号时也行不通-如果我尝试实现'isEqualToString'命令也行不通.我确信这是我犯的一个非常基本的错误.

That doesn't work - nor does it work when I take away the parentheses - nor does it work if I try to implement the 'isEqualToString' command. I'm sure this is a very basic mistake that i am making.

推荐答案

NSInteger不是对象,也不是字符串整数.

NSIntegers aren't objects, nor are strings integers.

请改用 if(AScore == 100&& BScore == 100){.

这篇关于iPhone NSInteger问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆