2010年5月13日木曜日

NSBundle (リソースの利用等)


NSBundleを初期化する

  • + bundleWithPath:
  • – initWithPath:

NSBundleを取得する

  • + bundleForClass:
  • + bundleWithIdentifier:
  • + mainBundle
  •   実行可能なアプリケーションが置かれたディレクトリを示すNSBundleオブジェクトを返す。
  • + allBundles
  • + allFrameworks

バンドルクラスを取得する

  • – classNamed:
  • – principalClass

リソースを見つける

  • + pathForResource:ofType:inDirectory:
  • (NSSTring *)pathForResource:(NSString *)name ofType:(NSString *)extention
  •  name.extentionのリソースのフルパスを返す。
  • – pathForResource:ofType:inDirectory:
  • – pathForResource:ofType:inDirectory:forLocalization:
  • + pathsForResourcesOfType:inDirectory:
  • – pathsForResourcesOfType:inDirectory:
  • – pathsForResourcesOfType:inDirectory:forLocalization:
  • – resourcePath

バンドルディレクトリを取得する

  • – bundlePath

Nibファイルをロードする

  • (NSArray *)loadNibNamed:(NSString *)name owner:(id)owner options:(NSDictionary *)options
  • レシーバのバンドルディレクトリにあるnibファイルを取り出す。
  •  name    nibファイル名(拡張子なし)
  •  owner   nibのFile's ownerオブジェクトとアサインされたオブジェクト
  •  option  nibファイルを開いたときオプションディレクトリ。Nib File Loading Optionを参照

バンドル情報を得る

  • – bundleIdentifier
  • – infoDictionary
  • – objectForInfoDictionaryKey:
  • – builtInPlugInsPath
  • – executablePath
  • – pathForAuxiliaryExecutable:
  • – privateFrameworksPath
  • – sharedFrameworksPath
  • – sharedSupportPath

ローカライズされたリソースを管理する


バンドルのコードを組み込む

  • – executableArchitectures
  • – preflightAndReturnError:
  • – load
  • – loadAndReturnError:
  • – isLoaded
  • – unload

ローカライズを管理する

  • + preferredLocalizationsFromArray:
  • + preferredLocalizationsFromArray:forPreferences:
  • – localizations
  • – developmentLocalization
  • – preferredLocalizations
  • – localizedInfoDictionary

0 件のコメント:

コメントを投稿