Is there a method, like containsObject: for NSMUtableArrays to check if an object exists in there without having to loop through the whole array and check each element? What's the best way to check if an object exists in an NSMutableArray?
+11
A:
NSMutableArray
inherits from NSArray
, so all of the NSArray
methods work for NSMutableArray
.
James Huddleston
2010-09-28 23:54:22
awakeFromNib: Worth noting: This is true generally. Unless otherwise stated in a method's documentation, all methods of a class will work on any subclass (or instance of a subclass) of that class. You'll take advantage of this most often with methods of the plist classes (with their mutable versions), NSView, NSControl, NSCell, and, of course, NSObject.
Peter Hosey
2010-09-29 04:34:33