iphone - Objective-C : Comparing CGPoints

标签 iphone objective-c ios ipad if-statement

我正在尝试为我的 CGPoints 做一个 if-else 语句 我怎么能做到这一点,我试过这段代码...

if (point1 != point2)
{
       //statement
}

我有这个错误

二进制表达式的无效操作数...

谢谢!

最佳答案

尝试改用函数CGPointEqualToPoint

if (!CGPointEqualToPoint(p1,p2))
{
  //statement
}

关于iphone - Objective-C : Comparing CGPoints,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8830742/

相关文章:

ios - IPP 通过 HTTP : getting 400 bad request as a response

ios - 单个文件中的多个@implementation block

iphone - 在核心数据中保存 CFDictionaryRef

iOS Objective-C : How to be notified when the user taps on the spacebar?

android - 电话拨号器中的字母标签是什么意思?

iphone - 如何使用 CHCSVParser 类

iphone - UITableViewCell 中的 UITextField 和正确用法

objective-c - 如何将字符串作为 UIButton 的标签传递

ios - 在 NSArray 中排序对象?

ios - 将 UIProgressView 连接到 UIWebView - Swift/Objective-c