On Sep 17, 2014, at 7:18 PM, Charles Jenkins <[email protected]> wrote: > > I know this is a stupid question that’s probably been asked many times > before, but I don’t find a way to search the cocoa-dev list to look for it. > > For several evenings I’ve been struggling to learn how to write my document’s > data out as an NSFileWrapper directory containing a group of RTF files. > > Everything finally worked today (yay!), but the resulting output appeared as > an ordinary directory of files (boo!). > > The Bundle Programming Guide offers this tantalizing bit of information: > >> To register a document as a package, you must modify the document type >> information in your application’s information property list (Info.plist) >> file. The CFBundleDocumentTypes key stores information about the document >> types your application supports. For each document package type, include the >> LSTypeIsPackage key with an appropriate value. The presence of this key >> tells the Finder and Launch Services to treat directories with the given >> file extension as a package. For more information about Info.plist keys, see >> Information Property List Key Reference. > > The Information Property List Key Reference does mention the LSTypeIsPackage > key, but it’s not clear where that key should appear in the Info.plist’s > structure. > > I used DuckDuckGo to search for LSTypeIsPackage and found that you set it by > checking the “Document is distributed as a bundle” box in the document type’s > section of the target’s Info property page. So I did that, but the files I > save still appear as directories. > > What configuration am I missing to get a document package which appears as a > single file?
The documentation is woefully out of date, or at least fails to adequately cover all topics. Your document type’s UTI must conform to com.apple.package. That’s a “physical” UTI, so you’ll probably want to conform too public.composite-content as well. Not that UTIs are semantically useful to any greater extent than file extensions, but there you have it. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
