对于 Objective-C, 两个 NSMutableArray isEqual 返回 YES, 无论它们是否相同的范型类型. 这个特性导致 NSOutlineView 在展开两个空的节点(对应着不同的空数组实例)时, 出现混乱. 当你点击展开 A 时, 它却展开 B. 这个可能是 NSOutlineView 内部使用 isEqual 来判断 item 是否相等, 而不是用 "==".
即使数组不是空的, 只要它们包含相同的内容, 都会出现这个 bug. 原因就是, 不应该用 isEqual 来判断, 而应该用 == 来判断指针是否相等.
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Transcending CSS
Andy Clarke、Molly E. Holzschlag / New Riders / November 15, 2006 / $49.99
As the Web evolves to incorporate new standards and the latest browsers offer new possibilities for creative design, the art of creating Web sites is also changing. Few Web designers are experienced p......一起来看看 《Transcending CSS》 这本书的介绍吧!