Check duplicate objects in NSMutableArray?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-03-29T14:40:59Z Indexed on 2010/03/29 14:43 UTC
Read the original article Hit count: 416

Filed under:
|

I am adding objects (NSNumbers in this case) to an NSMutableArray and I wanted to check what the best way is to check for duplicates in the array before adding. (i.e.)

Number to add
if (NSMutableArray does not contain Number) {
    add Number
}

gary

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa