FAQ Database Discussion Community


display local pdf file using UIDocumentInteractionControllerDelegate

ios,swift,uidocumentinteraction
I want to display a local pdf file using UIDocumentInteractionController Here is my code : pole = Pole.getWithMinor(minorBeacon) var address = pole.pdf if pole != nil { var urlpath = NSBundle.mainBundle().pathForResource(pole.pdf, ofType: "pdf") let url : NSURL! = NSURL(string: urlpath!) //pdfView.loadRequest(NSURLRequest(URL: url)) println(url) let docController = UIDocumentInteractionController(URL : url) docController.UTI...

EXC_BAD_ACCESS using UIDocumentInteractionController to sent Image to Instagram

ios,swift,ios8,uidocumentinteraction
I'm using this code to send and image (and eventually caption) to instagram: @IBAction func sendToInstragramPressed(sender: AnyObject) { var image = imagePreview.image var imagePath = NSString(format: "%@", [NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)][0]) var img: String = imagePath var clean: String = img.stringByReplacingOccurrencesOfString( "[\\(\\ \\\"\\)]", withString: "", options: .RegularExpressionSearch) clean = clean.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())...

UIDocumentInteractionController “invalid scheme (null)”

ios,excel,nsdata,preview,uidocumentinteraction
I'm trying to preview a document with UIDocumentInteractionController. The document is an .xls file which my app downloads from the web. I keep getting this error: 'UIDocumentInteractionController: invalid scheme (null). Only the file scheme is supported.' I use the next code: - (void) webServiceController:(WebServiceController *)webServiceController returnedArray:(NSMutableArray *)array { if ([webServiceController.webRequest...

UIDocumentInteractionController works but doesn't show “Save Image”

ios,uidocumentinteraction
I create and present a UIDocumentInteractionController with a valid url to a saved image but when I present the controller "Save Image" does not appear. NSURL *url = ...; self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:url]; [self.interactionController presentOptionsMenuFromBarButtonItem:sender animated:YES]; I have verified self.interactionController.UTI is a valid image type (jpeg) ______Actual_______ vs.____Expected_____ ____ Note*...