【发布时间】:2014-02-06 03:04:14
【问题描述】:
将应用程序与 instagram 集成.. 如何完成,请提前提供帮助,谢谢 这是我尝试过的代码
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"];
UIImage *image = [UIImage imageNamed:@"instagram.jpeg"];
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:YES];
NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath];
NSLog(@"%@",imageUrl);
UIDocumentInteractionController *docController = [[UIDocumentInteractionController alloc] init];
docController.delegate = self;
docController.UTI = @"com.instagram.photo";
docController.URL = imageUrl;
[docController setURL:imageUrl];
[docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
【问题讨论】:
-
请阅读您的帖子并尝试理解所要求的内容。
-
这是我尝试过的代码..但它不起作用你能帮忙吗?
-
你想做什么?与其只是粘贴一些代码,不如试着告诉我们到底是什么问题——为什么它不起作用,你想让它做什么,哪里出错了?
-
我必须将我的 iphone 应用程序与 instagram 集成。你知道怎么做吗?