title: iOS How to save data in Core Data from Text Fields and show these data in tableview?
body: <p>Hi i am Newbie in iOS and first time working on Core Data my task is that i have three text fields [name, email, dob] an one save button when i put data i text fields and press save button then data from text field save in core data and move to next page to show data in tableview.
  I have build core data file named as CoreData.xcdatamodeld and one entity and three attributes name, email and date of birth.</p>
  
  <pre><code>-(IBAction)saveButton:(id)sender{
      if (switchButton.isOn)
      {
          NSManagedObjectContext *context = [self managedObjectContext];
          NSManagedObject *transaction = [NSEntityDescription insertNewObjectForEntityForName:@"Shruti" inManagedObjectContext:context];
  
          NSManagedObject *name = [NSEntityDescription insertNewObjectForEntityForName:@"name" inManagedObjectContext:context];
          NSManagedObject *email = [NSEntityDescription insertNewObjectForEntityForName:@"email" inManagedObjectContext:context];
          NSManagedObject *dob = [NSEntityDescription insertNewObjectForEntityForName:@"dob" inManagedObjectContext:context];
  
          [name setValue:self.nameTextField.text forKey:@"name"];
          [email setValue:self.emailTextField.text forKey:@"email"];
          [dob setValue:self.dobTextField.text forKey:@"dob"];
  
          NSLog(@"Switch is On and data is saved in Core Data");
  
          TableViewController *objOfView = [[TableViewController alloc]initWithNibName:@"TableViewController" bundle:nil];
          [self.navigationController pushViewController:objOfView animated:YES];
      }
      else{
          NSLog(@"Switch is Off and data not saved in Core Data");
      }
  }
  </code></pre>
  
  <p>In core data i have entity name as Shruti nad three attributes name as name email and dob.
  Is it right if not then where i am wrong? </p>