title: I want to use identifiers in .m in other .m (implementation file import)
body: <p>On <code>cameraviewcontrolle.mr</code> I take a picture or movie using <code>UIImagePickerController</code>. On completion, I call back to <code>aanvraagviewcontroller.m</code>.  </p>
  
  <p>I want to save the the picture by tapping on send button.  </p>
  
  <p>My question comes to this I think, how can I import .m file or take the picture/movie to <code>aanvraagviewcontroller.m</code> (I use Parse.com to save my <code>PFObjects</code>)?</p>
  
  <p>This is <code>cameraviewcontroller.m</code></p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
      NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
  
      if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
          // A photo was taken/selected!
          self.image = [info objectForKey:UIImagePickerControllerOriginalImage];
          if (self.imagePicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
              // Save the image!
              UIImageWriteToSavedPhotosAlbum(self.image, nil, nil, nil);
          }
      }
      else {
          // A video was taken/selected!
          self.videoFilePath = (__bridge NSString *)([[info objectForKey:UIImagePickerControllerMediaURL] path]);
          if (self.imagePicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
              // Save the video!
              if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.videoFilePath)) {
                  UISaveVideoAtPathToSavedPhotosAlbum(self.videoFilePath, nil, nil, nil);
              }
          }
      }
      [self uploadMessage];
      [self dismissViewControllerAnimated:YES completion:nil];
      [self.navigationController popToRootViewControllerAnimated:YES];}
  
  
  
  
  - (void)uploadMessage {
      NSData *fileData;
      NSString *fileName;
      NSString *fileType;
  
      if (self.image != nil) {
          UIImage *newImage = [self resizeImage:self.image toWidth:320.0f andHeight:480.0f];
          fileData = UIImagePNGRepresentation(newImage);
          fileName = @"image.png";
          fileType = @"image";
      }
      else {
          fileData = [NSData dataWithContentsOfFile:self.videoFilePath];
          fileName = @"video.mov";
          fileType = @"video";
      }
  
      PFFile *file = [PFFile fileWithName:fileName data:fileData];
      [file saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
          if (error) {
              UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"An error occurred!"
                                                                  message:@"Please try sending your message again."
                                                                 delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
              [alertView show];
          }
          else {//            onderdeelAanvraag[@"file"] = file;
              //            onderdeelAanvraag[@"fileType"] = fileType;
              //            onderdeelAanvraag[@"recipientIDs"] = self.recipients;
              //
  
              if (error) {
                  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"An error occurred!"
                                                                      message:@"Please try sending your message again."
                                                                     delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                  [alertView show];
              }
              else {
                  // Everything was successful!
                  [self reset];
              }
              //            }];
          }
      }];
  }
  
  - (void)reset {
      self.image = nil;
      self.videoFilePath = nil;
      [self.recipients removeAllObjects];
  }
  
  - (UIImage *)resizeImage:(UIImage *)image toWidth:(float)width andHeight:(float)height {
      CGSize newSize = CGSizeMake(width, height);
      CGRect newRectangle = CGRectMake(0, 0, width, height);
      UIGraphicsBeginImageContext(newSize);
      [self.image drawInRect:newRectangle];
      UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      return resizedImage;
  }
  </code></pre>
  
  <p>This is <code>aanvraagviewcontroller.m</code> (when send button is pressed, i want to save the picture/movie here);</p>
  
  <pre><code>- (IBAction)verstuurAanvraag:(id)sender {
      NSString *onderdeelOmschrijving  = self.onderdeelOmschrijvingField.text ;
      NSString *autoOmschrijving = self.autoOmschrijvingField.text ;
  
  
      if  ([onderdeelOmschrijving length] == 0 ||
           [autoOmschrijving length] == 0)
      {
  
          UIAlertView *alertView = [[ UIAlertView alloc] initWithTitle:@"Leeg veld" message:@"Vul      de lege velden in" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
  
          [alertView show];
      }
  
      else {
  
          PFObject *onderdeelAanvraag = [PFObject objectWithClassName:@"Aanvragen"];
          [onderdeelAanvraag setObject:[PFUser currentUser] forKey:@"Aanvrager"];
          onderdeelAanvraag[@"OnderdeelOmschrijving"] = onderdeelOmschrijving;
          onderdeelAanvraag[@"AutoOmschrijving"] = autoOmschrijving;
          NSDate *date = [NSDate date];
          onderdeelAanvraag[@"Datum"] =date;
  
  
          onderdeelAanvraag[@"file"] = file;
          onderdeelAanvraag[@"fileType"] = fileType;
          onderdeelAanvraag[@"recipientIDs"] = self.recipients;
  
  
          // Get random number between 0 and 999999
          int nummer =  arc4random() % 100000;
          NSLog(@"nieuw nummer %d", nummer);
          [onderdeelAanvraag setObject:[NSNumber numberWithInt:nummer] forKey:@"AanvraagNummer"];
  
  
          [onderdeelAanvraag saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
              if (error) {
                  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:  [error.userInfo objectForKey:@"error"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
                  [alertView show];
              }
              else {
                  [self performSegueWithIdentifier:@"showRecipients" sender:self];
              }
          }];
  
      }
  }
  </code></pre>
  
  <p><strong>I SOLVED PASSING UITEXTFIELD TEXT BY THIS ;</strong></p>
  
  <pre><code>I solved passing textfield data passing with the segue method like here ;  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  if([segue.identifier isEqualToString:@"showRecipients"]){
      OntvangersViewController *controller;
      controller = [segue destinationViewController];
      controller.onderdeelOmschrijvingField = self.onderdeelOmschrijvingField;
      controller.autoOmschrijvingField = self.autoOmschrijvingField;
      controller.image = self.image;
      controller.videoFilePath = self.videoFilePath;
      NSLog(@"videofilepath %@", self.videoFilePath);
      controller.recipients = self.recipients;
  
  }
  </code></pre>
  
  <p>}    </p>