How to check if a NSMutableArray contains a value (null) or not?
11,393
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:
.
Comments
-
raaz almost 2 years
I have an
NSMutableArray
instance which contains "N" number of objects and I want to check whetherNSMutableArray
contains a (null) or any other value.In
NSString
there is a method calledisEqualToString:
Is there a similar method available forNSMutableArray
?Or otherwise, how can I do this?