title: NSMutable array adding entries?
body: <p>I am pretty new to objective-c and I am creating an app where records are held. I have tried to make an adding method when I click a save button though it doesn't save the data when you press the button or if it does it doesn't display it. The data is being shown in a tableView</p>
  
  <p>here is the code for the save button:</p>
  
  <pre><code>-(void)savePatient:(id)sender {
  LSAppDelegate *delegate = (LSAppDelegate *)[[UIApplication sharedApplication] delegate];
  NSMutableArray *patients = delegate.patients;
  
  UITextField *firstnameEntry = (UITextField *)[firstNameCell viewWithTag:777];
  UITextField *surnameEntry = (UITextField *)[surnameNameCell viewWithTag:777];
  UITextField *dobEntry = (UITextField *)[dobDateCell viewWithTag:777];
  UITextField *homeNumberEntry = (UITextField *)[homeNumberCell viewWithTag:777];
  UITextField *mobileNumberEntry = (UITextField *)[mobileNumberCell viewWithTag:777];
  UITextField *emailAddressEntry = (UITextField *)[emailAddressCell viewWithTag:777];
  UITextView *addressEntry = (UITextView *)[addressCell viewWithTag:777];
  
  if (firstnameEntry.text.length &gt; 0) {
      Patient *newPatient = [[Patient alloc] init];
      newPatient.patientName = firstnameEntry.text;
      newPatient.patientSurname = surnameEntry.text;
      newPatient.patientDoB = dobEntry.text;
      newPatient.patientHomeNumber = homeNumberEntry.text;
      newPatient.patientMobileNumber = mobileNumberEntry.text;
      newPatient.patientEmail = emailAddressEntry.text;
      newPatient.patientAddress = addressEntry.text;
      newPatient.patientPicture = nil;
      [patients addObject:newPatient];
      LSViewController *viewController = delegate.viewController;
      [viewController.tableView reloadData];
  }
      [delegate.navController popViewControllerAnimated:YES];
  
  }
  </code></pre>
  
  <p>I've found that the issue is here</p>
  
  <pre><code>if (firstnameEntry.text.length &gt; 0) {
  </code></pre>
  
  <p>please say if you want any more code</p>
  
  <p>Thanks in advance</p>