【问题标题】:What is the infoDictionary key to get the copyright defined in the bundle?获取捆绑包中定义的版权的 infoDictionary 键是什么?
【发布时间】:2011-11-22 21:50:24
【问题描述】:

我想使用“info plist”项目包中的版权。我找不到记录的密钥。有人知道密钥的价值吗?

[[[NSBundle mainBundle] infoDictionary] objectForKey: @"key-for-copyright"]

【问题讨论】:

    标签: iphone ipad nsbundle copyright-display


    【解决方案1】:

    它应该是 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!我想转储,但你在我之前就做到了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-04
    • 2010-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-18
    相关资源
    最近更新 更多