title: How to iterate an NSSet (Objective-C) - To-Many relationship representation in Core Data - efficiently?
body: <p>To-Many relationships in Core Data are represented by NSSet (as automatically generated by using the Editor... Create NSManagedObject Subclass.. menu.</p>
  
  <p>Which is the most efficient way to iterate an NSSet* ?</p>
  
  <pre><code>NSSet* groups = [contact groups];
  for(Group* group in groups) {
      NSString* groupName = [group name];
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>NSSet* groups2 = [contact groups];
  NSArray* groupsArray = [groups2 allObjects];
  for(Group* group in groupsArray) {
      NSString* groupName = [group name];
  }
  </code></pre>
  
  <p>or another way?</p>