Hi there,
I've got a class that wraps around an NSMutableSet
object, and I have an instance method that adds objects (using the addObject:
method) to the NSMutableSet
.
This works well, but I'm smelling a performance hitch because inside the method i'm explicitly calling containsObject:
before adding the object to the set.
Three part question:
- Do I need to be calling
containsObject:
before I add an object to the set? - If so, then what actual method should I be using,
containsObject
orcontainsObjectIdenticalTo:
? - If that is not so, what
contains
method gets invoked under the hood ofaddObject:
? This is important to me because if I pass an object tocontainsObject:
it would return true, but if I pass it tocontainsObjectIdenticalTo:
it would return false.
Thanks for everything, you guys rock!