If you can’t get an object with objectAtIndex: from an NSSet then how do you retrieve objects?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several use cases for a set. You could enumerate through (e.g. with
enumerateObjectsUsingBlockor NSFastEnumeration), callcontainsObjectto test for membership, useanyObjectto get a member (not random), or convert it to an array (in no particular order) withallObjects.A set is appropriate when you don’t want duplicates, don’t care about order, and want fast membership testing.