title: Two different Entry relationship in core data
body: <p>I am using core data with two different entieties </p>
  
  <ol>
  <li><p>userinformation. - firstname ,lastname , city etc</p></li>
  <li><p>phonenumber  -  number</p></li>
  </ol>
  
  <p>user information and  phone number between  i have given To many realtionship </p>
  
  <pre><code> -(NSArray*)getAllPhoneBookRecords
   {
  
  // initializing NSFetchRequest
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  
  //Setting Entity to be Queried
  
  NSEntityDescription *entity = [NSEntityDescription entityForName:@"userinformation"
                                            inManagedObjectContext:self.managedObjectContext];
  [fetchRequest setEntity:entity];
  
  NSError* error;
  
  // Query on managedObjectContext With Generated fetchRequest
  NSArray *fetchedRecords = [self.managedObjectContext executeFetchRequest:fetchRequest   error:&amp;error];
  
  
  for (NSManagedObject *info in fetchedRecords)
  {
      NSLog(@"city  name: %@", [info valueForKey:@"city"]);
      NSLog(@"first name: %@", [info valueForKey:@"firstName"]);
      NSLog(@"Last name: %@", [info valueForKey:@"lastName"]);
     NSLog(@"first phonenumber is %@",[info valueForKey:@"number"]);
  
  }
  </code></pre>
  
  <p>and I have calling  this method</p>
  
  <pre><code>AppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
  
  self.managedObjectContext = appDelegate.managedObjectContext;
  
  self.fetchedRecordsArray = [[appDelegate getAllPhoneBookRecords]mutableCopy];
  </code></pre>
  
  <p>but it is show only first table data and than it come</p>
  
  <pre><code>NSLog(@"first phonenumber is %@",[info valueForKey:@"number"]);   
  </code></pre>
  
  <p>it is showing Terminating app due to uncaught exception 'NSUnknownKeyException', reason: </p>
  
  <p><code>'[&lt;userinforamtion 0x84691b0&gt; valueForUndefinedKey:]: the entity userinforamtion is not key value coding-    compliant for the key "number</code></p>
  
  <p>but in phonenumber entity i have taken attribute for number </p>
  
  <p><strong>Am i doing the wrong realtionship between user inforamtion and phonenumber ?</strong></p>