我想使用放置在项目“info plist”中的版权。我找不到记录的密钥。有人知道钥匙的价值吗?
[[[NSBundle mainBundle] infoDictionary] objectForKey: @"key-for-copyright"]
我想使用放置在项目“info plist”中的版权。我找不到记录的密钥。有人知道钥匙的价值吗?
[[[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
)