kandi X-RAY | CCDC Summary
kandi X-RAY | CCDC Summary
CCDC
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of CCDC
CCDC Key Features
CCDC Examples and Code Snippets
Community Discussions
Trending Discussions on CCDC
QUESTION
I suspect this is a finicky configuration issue that I'm getting wrong with Document Type / UTI declarations in my Info.plist, but have tried several things and haven't found the solution.
I have an NSDocument-based Mac application, written in Swift, Xcode 11. It reads and writes a custom document type with suffix "mpxml".
During most early development I did not have a custom UTI identifier for the type (the identifier field was left blank, the project default), and the app was able to read and write these files.
Recently I changed to have a fully qualified document type identifier and editor, which seemed to be necessary to get my document icon to show up in the Finder. I changed all the places in my code referencing document type to use this fully qualified UTI. Everything now works except that the open panel (run by the default NSDocumentController openDocument) no longer recognizes my file type - all files with "mpxml" suffix are now grayed out in the open panel, including any files freshly created (the save panel works fine to write the documents).
Some things I've tried:
- adding some additional overrides to my NSDocument subclass: fileNameExtension(), writableTypes, etc.
- setting / omitting mime-type
- setting / omitting a 4-char OSType
- setting / omitting a reference URL
- removing mpxml extension from document type (so it's only defined in the UTI) - didn't work
- declaring the type as an Imported UTI as well (should not be needed, didn't fix the issue)
- reviewing docs: Developing a Document-Based App, Declaring New Uniform Type Identifiers
Worth noting: the documentation on CFBundleTypeExtensions (the relevant document-type plist key) says that it's ignored if LSItemContentTypes is set - which is the case, since LSItemContentTypes is the key for the UTI identifier. But if setting this breaks the document-type suffix affiliation, I'd expect the UTI export affiliation to re-connnect it.
Also: Open Recent is also broken, and on attempting to open a recently-saved document the error reported is that the app "cannot open files of this type".
I'm not sure a workaround bypassing NSDocumentController will work here, because I don't want to mess with the document instance / window / file associations it sets up behind the scenes.
What is missing to make the custom UTI and extension work correctly in this app?
UPDATE based on request here is additional Info.plist data relevant to this bug (which essentially agrees with the XCode document type information in the screenshot above). I've now created a minimal sample application which reproduces the bug that I'll be using for an Apple bug report.
In the original form of the project, which no custom UTI declared, the Info.plist document type declaration is:
...ANSWER
Answered 2020-Jun-17 at 10:32Your UTExportedTypeDeclarations
entry is missing UTTypeConformsTo
. This key is required. See Uniform Type Identifier Concepts - Conformance and Declaring New Uniform Type Identifiers.
Although a custom UTI can conform to any UTI, public.data or com.apple.package must be at the root of the conformance hierarchy for all custom UTIs that are file formats (such as documents);
Also:
You need to declare conformance only with your type’s immediate “superclass,” because the conformance hierarchy allows for inheritance between identifiers. That is, if you declare your identifier as conforming to the public.tiff identifier, it automatically conforms to identifiers higher up in the hierarchy, such as public.image and public.data.
QUESTION
I have a string like this:-
...ANSWER
Answered 2017-Jul-18 at 10:01i think you are looking for this,
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CCDC
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page