document-based

OS X App Sandboxing and arbitrary files access - Update to Document-based?

懵懂的女人 提交于 2020-01-04 06:31:29
问题 My OS X app (currently not sandboxed) accesses files contained inside a directory set by the user (one chooses the path with a NSOpenPanel and a reference to this path is kept throughout execution). The list of files is generated via NSDirectoryEnumerator and I then read from and write to those files using AVAsset and taglib (in C++ with a bridging header) respectively. As expected, enabling Sandboxing in Xcode rendered the app useless, the list of files given by NSDirectoryEnumerator is

How do I create icon for my documents in OS X

╄→尐↘猪︶ㄣ 提交于 2019-12-10 14:23:03
问题 I have a document-based application. So I need an icon for my app as well as an icon for my documents. In Xcode/Images.xcassets there is an item called AppIcon which I can use for setting the icon of the app. But how do I make an icon for my documents? Here is what I have tried under TARGETS/Document Types and TARGETS/Exported UTIs I have tried different methods suggested on Internet but nothing works. The doc icon is always blank and empty as you can see below: 回答1: It turns out that if you

How do I create an import-only document type in Cocoa?

雨燕双飞 提交于 2019-12-09 12:39:40
问题 There's a file type my application import but not save. I've added an entry to the document types and set it to read-only, but that doesn't yield the import behaviour that I'm looking for. Instead, my app will just open the file and when I save the original file is overwritten in my own file format. How to set up my document or document types to make it so that a new document is created with the data from the original document, instead of the original being opened? 回答1: 1. Declare the file

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

Tutorial/example of a minimal document-based app

瘦欲@ 提交于 2019-12-04 00:57:57
问题 I'm trying to understand how the things in Cocoa works but I'm struggling with one thing. I saw http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html and http://casperbhansen.wordpress.com/2010/08/15/dev-tip-nibless-development/ and I think I somewhat understood. Now, I would like to do the same but for a "Document-based application". Please, does anyone know of a tutorial or example akin to the ones above? Alternatively, what do I need to do to make it work? I think I need to

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.}

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

馋奶兔 提交于 2019-12-03 15:14:00
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 the file, either immediately or upon subsequent launches, even though the document is displayed. However,

How do I create an import-only document type in Cocoa?

血红的双手。 提交于 2019-12-03 14:37:32
There's a file type my application import but not save. I've added an entry to the document types and set it to read-only, but that doesn't yield the import behaviour that I'm looking for. Instead, my app will just open the file and when I save the original file is overwritten in my own file format. How to set up my document or document types to make it so that a new document is created with the data from the original document, instead of the original being opened? 1. Declare the file types as Document Types Within your Xcode project, add a Document Type for all the file formats your

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

☆樱花仙子☆ 提交于 2019-12-03 05:55:19
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.} Unlike similar questions ( 1 , 2 , 3 ) on SO on this, I am not using UIDocumentBrowserViewController . I am

What are the best uses of document stores?

馋奶兔 提交于 2019-12-03 04:50:39
问题 I have been hearing a lot about document oriented data stores like CouchDB. I understand the uses of BigTable like stores such as Cassandra. After reading this question, I was wondering what the conditions would be to merit using a document store? 回答1: Column-family stores such as Bigtable and Cassandra have very limited querying capabilities. The application is responsible for maintaining indexes in order to query a more complex data model. Document databases allow you to query the content,