简体   繁体   中英

How to check if a NSMutableArray contains a value (null) or not?

I have an NSMutableArray instance which contains "N" number of objects and I want to check whether NSMutableArray contains a (null) or any other value.

In NSString there is a method called isEqualToString: Is there a similar method available for NSMutableArray ?

Or otherwise, how can I do this?

NSMutableArray can only contain non- nil objects. Objects that print as (null) are typically nil .

The superclass method containsObject: will tell you whether a particular non- nil object is in the array. Note that this will only work if the objects are identical according to isEqual: .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM