ios - 如何检查 NSMutableArray 是否包含 NSMutableDictionary

标签 ios objective-c nsmutablearray nsmutabledictionary

我想检查 NSMutableArray 是否包含 NSMutableDictionary,我知道我们可以使用

检查 NSDictionary
  [array indexOfObjectIdenticalTo:dict];

但无法弄清楚如何检查 NSMutableDictionary。 任何提示都会很棒。

谢谢。

最佳答案

这应该有效:[array containsObject: dict];

编辑:

要获取索引,您可以使用:

NSUInteger index = [array indexOfObject: dict];

关于ios - 如何检查 NSMutableArray 是否包含 NSMutableDictionary,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29510044/

相关文章:

ios - AVMetadataFaceObject 精度

objective-c - 调整 UIToolbar 的大小以适合其项目?

iphone - 将NSString添加到NSMutableArray替代了之前的NSString

ios - UITableView 加载时 NSMutableArray 数据为零

iphone - UIWebview 创建 SVG 'on the fly'

ios - 通过Core Data API访问.sqlite文件

ios - UITabViewController : how to access the correct visible tab bar (selectedViewController showing wrong results)

ios - 从 Parse 查询 GeoPoint 并将其作为 MKAnnotation 添加到 MapKit?

iphone - 带有粗边框的 ModalView 旋转(如 iBooks 应用程序)

cocoa - 处理程序 block 和 NSArrays - 如何添加到 block 中的数组?