title: How to export an Image from our App to Instagram?
body: <p>I used following code but it didn't work.
  I want to put an image from my application to Instagram app installed on my iPhone..</p>
  
  <pre><code>NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"IMG_0192"  ofType:@"jpg"];
  fileToOpen = [fileToOpen substringToIndex:[fileToOpen length] - 3];
  fileToOpen=[NSString stringWithFormat:@"%@ig",fileToOpen];
  NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
  NSLog(@"%@",fileToOpen);
  if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
  //imageToUpload is a file path with .ig file extension
  /*UIAlertView *alert = [[UIAlertView alloc] 
                        initWithTitle:@"" 
                        message:@"Can open app!" 
                        delegate:self  
                        cancelButtonTitle:@"OK" 
                        otherButtonTitles:nil];
  [alert show];
  */
  
  self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:fileToOpen]];
  self.documentInteractionController.UTI = @"com.instagram.photo";
  self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"Its a testing" forKey:@"InstagramCaption"];
  </code></pre>
  
  <p>I tried a lot but it's not working at all.</p>