[NSBundle mainBundle] 详解

NSLog(@"ios 应用发布后 .app 应用文件 路径::%@",[NSBundle mainBundle] );

    NSLog(@"ios 应用发布后 .app 应用包(文件) 的详细信息 ::%@",[[NSBundle mainBundle] infoDictionary]);

 

 

[[NSBundle mainBundle] infoDictionary] 返回的是一个数据字典内容如下:

(XX1 为当前应用的名字 也就是app 包的名字 )--( 部分地方 XX 大写 我隐藏了部分信息...... )

 ios 应用发布后 .app 应用文件 ::{

    CFBundleDevelopmentRegion = en;

    CFBundleDisplayName = "当前app 文件名XX1";

    CFBundleExecutable = "当前app 文件名XX1";

    CFBundleExecutablePath = "/Users/yq-010/Library/Application Support/iPhone Simulator/5.1/Applications/49419CEE-6608-48FE-81FE-BF40FEEFB8F7/XX1.app/xx1";

    CFBundleIconFiles =     (

        "icon.png",

        "icon@2x.png"

    );

    CFBundleIcons =     {

        CFBundlePrimaryIcon =         {

            CFBundleIconFiles =             (

                "icon.png",

                "icon@2x.png"

            );

            UIPrerenderedIcon = 1;

        };

    };

    CFBundleIdentifier = "com.xxxx.xxxxx";

    CFBundleInfoDictionaryVersion = "6.0";

    CFBundleInfoPlistURL = "Info.plist -- file://localhost/Users/yq-010/Library/Application%20Support/iPhone%20Simulator/5.1/Applications/49419CEE-6608-48FE-81FE-BF40FEEFB8F7/XX%20XX%20XX.app/";

    CFBundleName = "XX1";

    CFBundlePackageType = APPL;

    CFBundleShortVersionString = "1.3";

    CFBundleSignature = "????";

    CFBundleSupportedPlatforms =     (

        iPhoneSimulator

    );

    CFBundleVersion = "1.3";

    DTPlatformName = iphonesimulator;

    DTSDKName = "iphonesimulator5.1";

    LSRequiresIPhoneOS = 1;

    NSBundleInitialPath = "/Users/yq-010/Library/Application Support/iPhone Simulator/5.1/Applications/49419CEE-6608-48FE-81FE-BF40FEEFB8F7/XX1.app";

    NSBundleResolvedPath = "/Users/yq-010/Library/Application Support/iPhone Simulator/5.1/Applications/49419CEE-6608-48FE-81FE-BF40FEEFB8F7/XX1.app";

    UIDeviceFamily =     (

        1

    );

    UIPrerenderedIcon = 1;

    UIRequiredDeviceCapabilities =     (

        armv7

    );

    UISupportedInterfaceOrientations =     (

        UIInterfaceOrientationPortrait

    );

}

 

应用1:我们可以通过包的信息的数据字典 得到 应用的版本 CFBundleVersion = "1.3";

当前应用的版本 :

[[[NSBundlemainBundleinfoDictionaryobjectForKey:@"CFBundleShortVersionString"]]

转载于:https://my.oschina.net/youtk21ai/blog/540702

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值