What is the infoDictionary key to get the copyright defined in the bundle?
Asked Answered
D

1

6

I want to use the copyright placed in the bundle of the project "info plist." I cannot find the key documented. Does anyone know the value of the key?

[[[NSBundle mainBundle] infoDictionary] objectForKey: @"key-for-copyright"]
Dibasic answered 22/11, 2011 at 21:50 Comment(0)
C
10

It should be NSHumanReadableCopyright. You can localize it too if needed, but it must be defined in the plist first.

Adding a useful suggestion if there is interest in any of the other keys:

NSLog(@"%s \n%@", __FUNCTION__, [[[NSBundle mainBundle] infoDictionary] allKeys]);

which yields a result like this:

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
)
Camise answered 22/11, 2011 at 21:54 Comment(3)
Thanks - I found it after I asked :) Also, I should have thought to dump the keys before I asked.Dibasic
It's ok, that's a great question.Camise
Thanks for the edit mobibob! I thought to dump, but you did it before me.Camise

© 2022 - 2024 — McMap. All rights reserved.