uidocument

UIDocument openWithCompletionHandler: crash

独自空忆成欢 提交于 2019-11-29 11:30:28
I'm using Core Data in my project and get a rare crash in the following code section -(void) useDocument{ AFFormsCoreDataEngine* engine = [AFFormsCoreDataEngine sharedInstance]; if (![[NSFileManager defaultManager] fileExistsAtPath: [engine.formsDatabase.fileURL path]]) { [engine.formsDatabase saveToURL: engine.formsDatabase.fileURL forSaveOperation: UIDocumentSaveForCreating completionHandler: ^(BOOL success){ // setup }]; } else if (engine.formsDatabase.documentState == UIDocumentStateClosed) { [engine.formsDatabase openWithCompletionHandler: ^(BOOL success){ // setup }]; } else if (engine

Does NSFileWrapper load everything into memory?

青春壹個敷衍的年華 提交于 2019-11-29 07:48:32
Lets say I have an NSFileWrapper directory. This directory is made up of several levels of directories and files. Some of the files are large. Are all these files loaded into memory, or are they lazily loaded? If they are loaded into memory, are there any alternatives to NSFileWrapper with similar functionality that won't load files into memory? Something I can hook into UIDocument ? This is for a document based application, which uses UIDocument 's that are synced with iCloud. A document can have images and videos embedded inside it. Each image/video has a preview image (thumbnail) that is

How to open the Document files e.g(.pdf,.doc,.docx) in ios mobile when a button action using swift3.0?

岁酱吖の 提交于 2019-11-28 09:21:23
I need to open UIDocumentPickerViewController and It should allow user to select all type of files. ie.(.pdf,.doc)files I used UIDocumentPickerViewController method. my Code: UIDocumentPickerDelegate, UIDocumentMenuDelegate in my class declaration //upload file func OpenFile(){ let importMenu = UIDocumentMenuViewController(documentTypes: [String(kUTTypePNG),String(kUTTypeImage)], in: .import) importMenu.delegate = self importMenu.modalPresentationStyle = .fullScreen self.present(importMenu, animated: true, completion: nil) } @available(iOS 8.0, *) public func documentPicker(_ controller:

Swift write/save/move a document file to iCloud drive

◇◆丶佛笑我妖孽 提交于 2019-11-28 06:36:55
I've been trying for over two days to write a file to iCloud drive. I have tried writing a simple text file directly, locally then moving it, using UIDocumentMenuViewController, etc. I'm not getting any errors with my code and stepping through debugger, it looks successful, but when I check to see if the file exists or at least the iCloud directory, there is nothing there. I tried on both the simulator and my iPhone, triggering iCloud synching, and everything else I can think of. My main goal is to simply write a text file to the iCloud drive, which later will be "numbers" file I have set up

UIDocument openWithCompletionHandler: crash

不打扰是莪最后的温柔 提交于 2019-11-28 05:02:07
问题 I'm using Core Data in my project and get a rare crash in the following code section -(void) useDocument{ AFFormsCoreDataEngine* engine = [AFFormsCoreDataEngine sharedInstance]; if (![[NSFileManager defaultManager] fileExistsAtPath: [engine.formsDatabase.fileURL path]]) { [engine.formsDatabase saveToURL: engine.formsDatabase.fileURL forSaveOperation: UIDocumentSaveForCreating completionHandler: ^(BOOL success){ // setup }]; } else if (engine.formsDatabase.documentState ==

Save iOS 8 Documents to iCloud Drive

青春壹個敷衍的年華 提交于 2019-11-27 07:30:51
I want to have my app save the documents it creates to iCloud Drive, but I am having a hard time following along with what Apple has written. Here is what I have so far, but I'm not for sure where to go from here. UPDATE2 I have the following in my code to manually save a document to iCloud Drive: - (void)initializeiCloudAccessWithCompletion:(void (^)(BOOL available)) completion { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ self.ubiquityURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; if (self.ubiquityURL != nil) { dispatch

How to open the Document files e.g(.pdf,.doc,.docx) in ios mobile when a button action using swift3.0?

假如想象 提交于 2019-11-27 02:27:38
问题 I need to open UIDocumentPickerViewController and It should allow user to select all type of files. ie.(.pdf,.doc)files I used UIDocumentPickerViewController method. my Code: UIDocumentPickerDelegate, UIDocumentMenuDelegate in my class declaration //upload file func OpenFile(){ let importMenu = UIDocumentMenuViewController(documentTypes: [String(kUTTypePNG),String(kUTTypeImage)], in: .import) importMenu.delegate = self importMenu.modalPresentationStyle = .fullScreen self.present(importMenu,

Save iOS 8 Documents to iCloud Drive

巧了我就是萌 提交于 2019-11-26 13:22:12
问题 I want to have my app save the documents it creates to iCloud Drive, but I am having a hard time following along with what Apple has written. Here is what I have so far, but I'm not for sure where to go from here. UPDATE2 I have the following in my code to manually save a document to iCloud Drive: - (void)initializeiCloudAccessWithCompletion:(void (^)(BOOL available)) completion { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ self.ubiquityURL = [

Add “Edit in Excel” or “Edit photo” extension

别来无恙 提交于 2019-11-26 09:56:17
问题 I checked the latest Dropbox and Excel for iOS. In Dropbox we get an edit button. On click it opens Excel\'s extension where you can edit the file. After save, changes are reflected in the Dropbox file too. I want to add such a button. Also I\'d like to add such a button to images to open them in available \"photo editing\" apps. How to check if file (image, xls, doc or any other) can be opened to edit? Code so far: UIDocumentPickerViewController *documentPicker = [