6
我想使用放置在項目「info plist」包中的版權。我找不到記錄的關鍵。有誰知道鑰匙的價值?什麼是infoDictionary鍵來獲得捆綁中定義的版權?
[[[NSBundle mainBundle] infoDictionary] objectForKey: @"key-for-copyright"]
我想使用放置在項目「info plist」包中的版權。我找不到記錄的關鍵。有誰知道鑰匙的價值?什麼是infoDictionary鍵來獲得捆綁中定義的版權?
[[[NSBundle mainBundle] infoDictionary] objectForKey: @"key-for-copyright"]
它應該是NSHumanReadableCopyright。如果需要,也可以將其本地化,但必須先在plist中定義。
添加有益的建議,如果有任何其他鍵的興趣:
NSLog(@"%s \n%@", __FUNCTION__, [[[NSBundle mainBundle] infoDictionary] allKeys]);
這將產生這樣的結果:
2011-11-22 17:08:02.072 MyApp [1007:707] -[SplashScreenViewController viewWillAppear:]
(
CFBundleSignature,
DTSDKName,
DTPlatformBuild,
BuildMachineOSBuild,
NSBundleInitialPath,
NSHumanReadableCopyright,
CFBundleExecutable,
CFBundleIconFiles,
LSRequiresIPhoneOS,
CFBundleInfoPlistURL,
NSMainNibFile,
CFBundleShortVersionString,
CFBundlePackageType,
NSBundleResolvedPath,
DTSDKBuild,
CFBundleResourceSpecification,
DTXcodeBuild,
DTCompiler,
CFBundleDisplayName,
CFBundleDevelopmentRegion,
UTExportedTypeDeclarations,
DTPlatformName,
CFBundleURLTypes,
CFBundleName,
CFBundleVersion,
UTImportedTypeDeclarations,
CFBundleDocumentTypes,
DTPlatformVersion,
CFBundleSupportedPlatforms,
DTXcode,
MinimumOSVersion,
UISupportedInterfaceOrientations,
CFBundleIdentifier,
UIAppFonts,
UIDeviceFamily,
CFBundleExecutablePath,
CFBundleInfoDictionaryVersion
)
謝謝 - 我發現後,我問:)另外,我應該考慮在我問之前丟掉鑰匙。 – mobibob
沒關係,這是一個很好的問題。 – CodaFi
感謝編輯mobibob!我想轉儲,但你在我之前做過。 – CodaFi