What's the right way to go about saving data like Pages, Numbers and other OSX applications do? That is, it looks like a file to the user, but is in fact a directory (a bundle?) containing a variety of stuff. I have some fairly complex data that I'd like to store in the same way; in particular, some sensor data that needs to be associated with video files.
+3
A:
The Apple official docs on the topic are probably a good starting point.
From the Pages Info.plist file:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pages</string>
</array>
[...]
<key>LSTypeIsPackage</key>
<true/>
[...]
</dict>
</array>
seem to be what does the trick.
Sii
2009-04-30 20:51:28
Ahh, that's it! A remarkably difficult topic to search upon without knowing what it's called!
Dan
2009-04-30 21:59:29
+1
A:
It also looks like NSFileWrapper
may be part of the answer:
Document-Based Applications Overview FAQ.
Dan
2009-05-01 01:38:49