获取应用程序的名称和版本号

 NSDictionary* infoDict =[[NSBundlemainBundle] infoDictionary];

 NSString*appName =[infoDictobjectForKey:@"CFBundleDisplayName"];  // 应用程序名称

 NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];  // 应用程序版本号

在此将infoDict打印出来

2014-11-07 14:20:51.339 XiaomaTOEFL[6913:60b] -[OIK_FeedBackViewController sendBtnAction](149): {

    BuildMachineOSBuild = 13F34;

    CFBundleDevelopmentRegion = en;

    CFBundleDisplayName = XiaomaTOEFL;

    CFBundleExecutable = XiaomaTOEFL;

    CFBundleIdentifier = "com.xiaoma.XiaoMaTuoFu";

    CFBundleInfoDictionaryVersion = "6.0";

    CFBundleInfoPlistURL = "Info.plist -- file:///var/mobile/Applications/ED2D2912-E523-49DE-8281-0A1508885E8C/XiaomaTOEFL.app/";

    CFBundleName = XiaomaTOEFL;

    CFBundleNumericVersion = 83984384;

    CFBundlePackageType = APPL;

    CFBundleShortVersionString = "5.0.0";

    CFBundleSignature = "????";

    CFBundleSupportedPlatforms =     (

        iPhoneOS

    );

    CFBundleURLTypes =     (

                {

            CFBundleTypeRole = Editor;

            CFBundleURLSchemes =             (

                "sina.5416b4d0fd98c565690171cf"

            );

        },

                {

            CFBundleTypeRole = Editor;

            CFBundleURLSchemes =             (

                tencent101042219

            );

        }

    );

    CFBundleVersion = "5.0.1";

    DTCompiler = "com.apple.compilers.llvm.clang.1_0";

    DTPlatformBuild = 12B411;

    DTPlatformName = iphoneos;

    DTPlatformVersion = "8.1";

    DTSDKBuild = 12B411;

    DTSDKName = "iphoneos8.1";

    DTXcode = 0610;

    DTXcodeBuild = 6A1052d;

    LSRequiresIPhoneOS = 1;

    MinimumOSVersion = "7.0";

    UIDeviceFamily =     (

        1

    );

    UILaunchImages =     (

                {

            UILaunchImageMinimumOSVersion = "7.0";

            UILaunchImageName = "LaunchImage-700-568h";

            UILaunchImageOrientation = Portrait;

            UILaunchImageSize = "{320, 568}";

        }

    );

    UIRequiredDeviceCapabilities =     (

        armv7

    );

    UISupportedInterfaceOrientations =     (

        UIInterfaceOrientationPortrait,

        UIInterfaceOrientationLandscapeLeft,

        UIInterfaceOrientationLandscapeRight

    );

    UIViewControllerBasedStatusBarAppearance = 0;

}


可见infoDict包含了项目中几乎所有的基本信息。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值