LaunchServices:invalidationHandler被调用

时间:2016-04-08 12:03:55

标签: ios objective-c uiactivityviewcontroller

在分享UIImage到facebook / twitter时收到错误

  

LaunchServices:invalidationHandler,名为

-(IBAction)ShareBtnClicked:(id)sender {
[self calculateInterstitialAdsCounts];

NSURL *fileURL;
docInteracCont.delegate = self;

//Save the Image to default Document directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:TEMP_PIC_NAME];

self.rawImage = _imageView.image;

BOOL prefs = [[NSUserDefaults standardUserDefaults ]boolForKey:WATERMARK_REMOVED];
if(!prefs)
{
    self.rawImage = [Utility imageWithWaterMark:_imageView.image];
}


NSData *imageData = UIImageJPEGRepresentation(self.rawImage, 1.0);

[imageData writeToFile:savedImagePath atomically:false];
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:TEMP_PIC_NAME];
fileURL = [[NSURL alloc] initFileURLWithPath:getImagePath];

// Open the Document Interaction controller for Sharing options (in Menu) 
// docInteracCont = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
// [docInteracCont presentOpenInMenuFromRect:CGRectZero inView:self.view animated:true];
NSArray *objectsToShare = @[textToShare, fileURL];

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];

activityVC.excludedActivityTypes = @[UIActivityTypeCopyToPasteboard];
activityVC.popoverPresentationController.sourceView = self.view;

[self presentViewController:activityVC animated:YES completion:nil];
}

并且无法找到导致错误的原因。 部署目标7.0 在iPhone5上运行 应用程序是通用的,即iPad和iPhone。错误即将来临,但图片仍然在Facebook上共享,我想在应用程序上实现视频广告,并获得如何实现它的路径。请分享一些想法

0 个答案:

没有答案