title: Problem with CoreData and accessing relationships : request for member in something not a structure or union
body: <p>I have a question regarding a rather advanced DataModel which I would like to use with CoreData.</p>
  
  <p>Before I get into details about what I did so far, I will describe what I want to do.</p>
  
  <p>I have a List of Hotel Guests that stay in one Room and have Preferences. Once ready the user should select a guest and see the data and should also be able to add new guest, select the room (maintained also by application) and select their preferences (where the user can also add new preferences). The guest can have no or many preferences.</p>
  
  <p>So here is what I have so far. I created 3 Entities : - Rooms with roomnumber - Preferences with name - GuestInfo with name -> with these Relationships room (Destination Rooms) and prefs (Destination Preferences with "To-Many Relationship") The prefs is a NSSet when you create a Managed Object Class.</p>
  
  <p>So far so good. Now I have a UITableViewController that displays all guests, when I click on a guest I have another UITableViewController showing the details(DetailsViewController). Clicking on the Preferences it will go to another UITableViewController where I can select the Preferences. The problem I have is when I want to actually access the prefs in the DetailsViewController. Here is my cellForRowAtIndexPath:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
  {
  
      static NSString *CellIdentifier = @"Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) 
      {
          cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];
          cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
      }
  
  switch (indexPath.row) 
  {
    case 2:
      cell.textLabel.text = @"Preferences";
  
      NSEnumerator *e = [info.prefs objectEnumerator];
      id collectionMemberObject;
  
      while ( (collectionMemberObject = [e nextObject]) ) 
      {
  
      Preferences *prefInfo = collectionMemberObject;         
      DebugLog(@"===&gt; %@", prefInfo.name);
  
      }
  
      break;
  }
  </code></pre>
  
  <p>info is the GuestInfo I pass through to the DetailsViewController.</p>
  
  <p>Now with this I do get <strong>"request for member in something not a structure or union"</strong> accessing prefInfo.name. </p>
  
  <p>Any idea whats wrong ?</p>
  
  <p>thx</p>