フォルダを読み込む為のCFBundleDocumentTypesの設定
NSDocumentControllerでfolderを受け付ける為に、info.plistの設定を行った。 フォルダータイプを受け付ける為に、CFBundleDocumentTypesの項目に以下の項目を追加した。
キー | 値 | 説明 |
---|---|---|
CFBundleTypeExtensions | * | 任意の拡張子を表す |
CFBundleTypeOSTypes | fold | OS9でフォルダーを示すOSType |
しかし、今資料を見たら、これらの設定が”Deprecated”との事。 今のところ動作には問題はないようだが、”Deprecated”な物を使うのは気持ちが悪いので変更する。
単純に書くと
- CFBundleTypeExtensionsとCFBundleTypeOSTypesを削除
- LSItemContentTypesとLSHandlerRankを追加
で終わり。 詳しく書くと、
変更前のinfo.plistは以下
ターゲットのinfoタブでは以下
両方とも同じinfo.plistファイルの内容を反映して表示しています。
変更後のinfo.plistは以下
ターゲットのinfoタブでは以下
CFBundleTypeExtensionsとCFBundleTypeOSTypesを削除し、LSItemContentTypesとLSHandlerRankを追加した。
キー | 値 | 説明 |
---|---|---|
LSItemContentTypes | public.folder | フォルダーを表すUTI |
LSHandlerRank | none |
扱うファイルがLSHandlerRankの値は、扱うファイルがフォルダーの為にnoneとした。
参考文献
- iOSアプリケーションを特定のファイル形式に対応させる方法について :
- http://safx-dev.blogspot.jp/2010/11/ios_21.html
- UTI一覧 : System-Declared Uniform Type Identifiers
- http://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/UTIRef/Introduction/Introduction.html
- Info.plist用のキー一覧 : information Property list key Refarence
- http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html