So I have the first class:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *chosenImage = info[UIImagePickerControllerOriginalImage];
self.imageView.image = chosenImage;
_camera_button.hidden = true;
_camera_imageview.hidden = false;
[_next_camera setEnabled:YES];
NSData *imageData = UIImagePNGRepresentation(chosenImage);
[self upload_selfie:imageData];
[picker dismissViewControllerAnimated:YES completion:NULL];
}
And I am wanting to transfer the variable: imageData
to this class:
- (IBAction)upload_selfie:(NSData *)sender{
PFFile *imageFile = [PFFile fileWithName:@"Image.jpg" data:imageData];
// Save PFFile
[imageFile saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
// Hide old HUD, show completed HUD (see example for code)
// Create a PFObject around a PFFile and associate it with the current user
PFObject *userPhoto = [PFObject objectWithClassName:@"UserPhoto"];
[userPhoto setObject:imageFile forKey:@"imageFile"];
// Set the access control list to current user for security purposes
userPhoto.ACL = [PFACL ACLWithUser:[PFUser currentUser]];
PFUser *user = [PFUser currentUser];
[userPhoto setObject:user forKey:@"user"];
[userPhoto saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
// _loader6.hidden = true;
// [self performSegueWithIdentifier:@"toquestion" sender:self];
}
else{
// Log details of the failure
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
}
}];
}
Where I have tried:
PFFile *imageFile = [PFFile fileWithName:@"Image.jpg" data:imageData];
But I receive the error "Use of undeclared identifier"?ces where I refrence imageData
should I somewhere else?
Also these are the only two pla
Please may you explain why and what I can do about this?