How to access objects in a set?


How is it done? Ive checked the reference page for NSSet but only found the method ‘anyObject’ which returns a random set member. But what if I know which set member I want to grab?


I have not used NSSet, but if you use the OPTION key and cursor over the keyword NSSet in your code, you can get access to the documentation.

I suppose of interest would be these accessors:

  • (NSArray *)allObjects;
  • (NSEnumerator *)objectEnumerator;

see the documentation for more.