Determining Equality of Objects

  If you need to determine whether one object is the same as another object, it’s important to remember that you’re working with pointers. The standard C equality operator == is used to test equality between the values of two variables, like this:

  

  When dealing with objects, the == operator is used to test whether two separate pointers are pointing to the same object:

  

  If you need to test whether two objects represent the same data, you need to call a method like isEqual:, available from NSObject:

  

  If you need to compare whether one object represents a greater or lesser value than another object, you can’t use the standard C comparison operators > and <. Instead, the basic Foundation types, like NSNumber, NSString and NSDate, provide a compare: method:

  

  

最新文章

  1. inotify +rsync进行实时同步
  2. 学C#你应该熟练使用ILDasm和Reflector【带视频教程】
  3. PHP的错误报错级别设置原理简析
  4. So... what&#39;s up?
  5. php的socket通信(一)
  6. Oracle异常处理内容,隐式游标
  7. python 之编码问题详解
  8. C#实现防拷贝工具示例
  9. T-SQL 脚本
  10. C++死锁解决心得
  11. ios runtime 打印内 内部调用的属性
  12. (BUG记录)记一次与其他系统交互协作时造成的锁表问题
  13. c++ 程序崩溃生成Dump文件
  14. mybatis查询如何返回List&lt;Map&gt;类型数据
  15. P1330 封锁阳光大学 DFS
  16. 洛谷P4344 [SHOI2015]脑洞治疗仪(ODT)
  17. kbmmw 5.01 发布
  18. 【译】理解node.js事件轮询
  19. C/C++ 语言 Hello world
  20. Leetcode题库——9.回文数

热门文章

  1. hdu1054(二分图匹配)
  2. jQuery_效果(隐藏和显示)
  3. 51nod1711 平均数
  4. hadoop1常见配置含义
  5. 总结swift 1.2适配swift2.0遇到的改变
  6. 菜鸟学习笔记4——jquery事件
  7. 【自动化测试】PO思路
  8. Android Studio Check for Update
  9. tomcat Manger App
  10. phpmyadmin 设置用户登录