【发布时间】:2015-01-30 19:32:28
【问题描述】:
我正在开发一个应用程序,我们需要在 instagram 上一次共享多个图像。我搜索了很多,但找不到任何解决方案。我正在使用在 Instagram 上共享单个图像的代码:
NSString *imagePath = [NSString stringWithFormat:@"%@/image.igo",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]];
[[NSFileManager defaultManager] removeItemAtPath:imagePath error:nil];
UIImage *sharingImg = (UIImage *)[self.watermarkedImagesArr objectAtIndex:0];
sharingImg =[self imageWithImage:sharingImg scaledToSize:CGSizeMake(sharingImg.size.width/4, sharingImg.size.height/4)];
[UIImagePNGRepresentation(sharingImg) writeToFile:imagePath atomically:YES];
NSURL *instagramURL = [NSURL fileURLWithPath:imagePath];
_docController = [UIDocumentInteractionController interactionControllerWithURL:instagramURL];
_docController.delegate = self;
_docController.UTI = @"com.instagram.exclusivegram";
self.docController.annotation = [NSDictionary dictionaryWithObject:@"Photo watermark app" forKey:@"InstagramCaption"];
[self.docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
任何帮助将不胜感激。提前致谢。
【问题讨论】: