While share image like normal image it will work fine. But when getting image from UIImageView
and share it throwing an error.
how to resolve this issue?
and share image.
Where is issue in my code.
NSString * title =[NSString stringWithFormat:@"Address: \n %@",self.label.text];
UIImage *image = self.imageView.image;
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:@[title, image] applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:^{}];
Error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[MFMailComposeInternalViewController addAttachmentData:mimeType:fileName:] attachment must not be nil.'