For completeness and possibly my own reference, here are some details later that made me work for me:
Declaring document types supported by your application (e.g. sqlite3 database)
<key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeIdentifier</key> <string>com.company.sqlite3.database</string> <key>UTTypeReferenceURL</key> <string>http://www.company.com/</string> <key>UTTypeDescription</key> <string>MyCompany SQLite Database</string> <key>UTTypeIconFile</key> <array> <string>Icon-Small.png</string> <string>Icon.png</string> </array> <key>UTTypeConformsTo</key> <array> <string>public.database</string> <string>public.data</string> </array> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>sqlite</string> </array> <key>public.mime-type</key> <array> <string>application/x-sqlite3</string> <string>application/octet-stream</string> </array> </dict> </dict> </array> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>MyCompany SQLite Database</string> <key>CFBundleTypeIconFiles</key> <array> <string>Icon-Small.png</string> <string>Icon.png</string> </array> <key>CFBundleTypeExtensions</key> <array> <string>sqlite</string> </array> <key>CFBundleTypeMIMETypes</key> <array> <string>application/x-sqlite3</string> <string>application/octet-stream</string> </array> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>com.company.sqlite3.database</string> </array> <key>NSPersistentStoreTypeKey</key> <string>SQLite</string> </dict> </array>
Copy the above XML into your Info.plist file.
Setting the Store Type type to SQLite was not a problem for me for the killer.
My previous post mentioned a rather incorrect way to make it work, which accepts all files and did not export this type correctly.
Also, if your application sends these files as attachments, make sure that it matches the MIME type that you set to capture it. The flow of applications / octets is not important, as older versions of our application email databases with this MIME type.
eg,
[controller addAttachmentData:[NSData dataWithContentsOfFile:dbPath] mimeType:@"application/x-sqlite3" fileName:filename];
I'm sure someone else who is trying to find out how to get their application to support opening sqlite3 database backups finds this useful.
Josh Peak Jul 04 '11 at 4:18 2011-07-04 04:18
source share