2011-11-22 4 views
6

मैं प्रोजेक्ट "जानकारी प्लिस्ट" के बंडल में रखे गए कॉपीराइट का उपयोग करना चाहता हूं। मुझे कुंजी दस्तावेज नहीं मिल रहा है। क्या किसी को कुंजी का मूल्य पता है?बंडल में परिभाषित कॉपीराइट प्राप्त करने के लिए infoDictionary कुंजी क्या है?

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

उत्तर

10

यह NSHumanReadableCopyright होना चाहिए। यदि आवश्यक हो तो आप इसे भी स्थानीयकृत कर सकते हैं, लेकिन इसे पहले प्लिस्ट में परिभाषित किया जाना चाहिए।

अगर वहाँ अन्य कुंजियों में से किसी में रुचि है एक उपयोगी सुझाव जोड़ना:

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 
) 
+0

धन्यवाद - मुझे मिल गया के बाद मैं :) पूछा इसके अलावा मुझे पूछने से पहले चाबियों को डंप करना चाहिए था। – mobibob

+0

यह ठीक है, यह एक अच्छा सवाल है। – CodaFi

+0

संपादन mobibob के लिए धन्यवाद! मैंने डंप करने के लिए सोचा, लेकिन तुमने मेरे सामने यह किया। – CodaFi

संबंधित मुद्दे

 संबंधित मुद्दे