uidocument

UIDocument & NSFileWrapper Architecture and Performance

北城余情 提交于 2019-12-08 23:51:38
问题 We've recently converted our code to use UIDocument instead of manipulating files on the file system directly, and we've encountered some performance issues as a result. We are wondering whether we are using this class incorrectly, if anyone else had these issues, and what are the common ways to address them. Our app We have a "shoebox app" that manages a bunch of documents, each consisting of multiple image files that can be quite heavy, a small metadata file and a small preview image. The

Pre load core data database coming up black with UIManagedDocument

本小妞迷上赌 提交于 2019-12-08 07:44:57
问题 Hi supportive experts... I'm writing my first iPad app and have a working beta copy that parses an XML file to create a UIManagedDocument Core Data DB on app start up. However this takes a long time and I would like to do it once off line and include the initial data directly into my app bundle. Needless to say I'm hitting a wall trying to get it to work. I first followed the command line utility approach see here This worked until I imported the .sqlite file and tried to edit the

iOS 6 sharing like Messages, not like Photos (UIActivityViewController and UIDocumentInteractionController)

こ雲淡風輕ζ 提交于 2019-12-07 06:09:06
问题 In iOS 6, tapping the action button in the Photos app presents the standard UIActivityViewController: Doing the same from Messages presents a different set of options. This looks to me like it's using the UIDocumentInteractionController api to pull all the apps that say they can handle an image. My question is twofold: How does one get into the Messages action menu? Tumblr and Halftone, to name a few, have done it... I can't seem to find the documentation. How does one show the Messages-style

How can I sort an icloud NSMetadataQuery result of UIDocument's by modification date?

南笙酒味 提交于 2019-12-07 00:36:09
问题 I have an iOS application that uses a simple UIDocument model with a single content field for iCloud storage. I retrieve the list of documents to populate a UITableView using an NSMetadataQuery. I want to have new documents appear at the top of this table, but the default sorting appears to be old -> new. I know if I had a custom date field in the document I could sort the query with the NSSortDescriptor on that field but my question is is it possible to sort by the intrinsic modification

NSMetadataQuery does not find NSFileWrapper folder bundles, only files (but they're there)

五迷三道 提交于 2019-12-06 07:24:49
I have a strange problem which I can't seem to solve on my own. Any help or thought is appreciated. The problem: NSMetadataQuery finds normal files (like test.txt) but no filewrapper bundle (myWrapperDocument.pro) However, NSFileManager finds all files in my ubiquity container - so the files are there, but NSMetadataQuery doesn't find them! The facts: UIDocument based app using NSFileWrappers Shared Ubiquity Container (for iOS and Desktop app) Works perfect on Mac OS Works perfect on my iPad Mini and my iPhone 4S and iPhone 3GS (running iOS6 and iOS5) Doesn't work on my iPad1 nor on most of my

What is the proper way to move a UIDocument to a new location on the file-system

喜你入骨 提交于 2019-12-05 00:25:09
问题 I have a document-based iOS application with a UIDocument subclass. I need to be able to move the file it represents on the file-system. I have considered moving it with an NSFileManager , but this would mess up the UIDocument 's fileURL property. Any ideas on how to solve this little conundrum? 回答1: You can rename a UIDocument by first closing it, and then in the completion handler, moving the file using NSFileManager. Once the file has been successfully moved, initialize a new instance of

Having Trouble Getting the UIDocumentBrowserController to open docs in a Document based app

半世苍凉 提交于 2019-12-05 00:24:05
问题 I've been working on a new Document-based app, and was super glad about the new UIDocumentBrowserController...trying to roll my own solution for the document browser UI was tricky! I'm having some trouble getting the browser to open documents after they've been created. What happens now is that when I choose to create a new document in the document browser, the document is created and opened as expected, although an error message is logged. However, after the doc is closed, I cannot reopen

openWithCompletionHandler prob in 5.1 sim

谁说胖子不能爱 提交于 2019-12-04 03:53:38
问题 I'm puzzled. I'm finding that the UIDocument method openWithCompletionHandler works in the iOS 5 and IOS 6 sims, but not in the one for iOS 5.1. Any thoughts on how I work around this? Is it just one of those things where the sim falls down but the real environment doesn't? Thanks. Steve 回答1: I see something similar. In openWithCompletionHandler the completion handler is never called. In saveToURL , the app freezes completely. As for you this only happens in the 5.1 simulator. 5.0 and now 6.1

UIDocument & NSFileWrapper - large files taking a long time to save, despite incremental changes

╄→гoц情女王★ 提交于 2019-12-04 03:39:39
I have a UIDocument based app that uses NSFileWrapper s to store data. The 'master' file wrapper contains many additional directory file wrappers, each of which represents a different page of the document. When saving a large document for which only a small proportion of one page has been modified, UIDocument spends a LONG time in the background writing the changes (in writeContents:andAttributes:safelyToURL:forSaveOperation:error: ). Surely it should only be writing out this one small change to the file wrapper... what's taking so long? My contentsForType:error: override returns a new

UIDocument Creation on iOS 11: reader is not permitted to access the URL

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:40:37
问题 Since iOS 11 I have encountered the following error every time I am creating a new document using UIDocument API: [ERROR] Could not get attribute values for item /var/mobile/Containers/Data/Application/XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/Documents/myDoc-XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX.myFile (n) . Error: Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the URL." UserInfo={NSLocalizedDescription=The reader is not permitted to access the URL.}