2
я использую этот метод, чтобы принять захват экрана:Как добраться до последней фотографии из библиотеки фотографий?
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage*theImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(theImage, nil, nil, nil);
и я хочу, чтобы получить путь к этой фотографии, так что я могу использовать его с методами Instagram
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", lastphotoTaken]];
// NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", lastphotoTaken]];
self.dic.UTI = @"com.instagram.exclusivegram";
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic=[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
self.dic.annotation = [NSDictionary dictionaryWithObject:@"Here Give what you want to share" forKey:@"InstagramCaption"];
[self.dic presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
Thanx
спасибо, но URL для моего изображения: 'активы-библиотека: //asset/asset.JPG ID = 7D636703-8786-465D-B896-A0A67F0B0CCE и внутр = JPG' как конвертировать это таким образом 'file: // ...' – AsimNet
@AsimNet: вы не можете сделать это с помощью URL-адресов ресурсов. Или хранить изображения в каталоге документов вместо фотобиблиотеки –