zoukankan      html  css  js  c++  java
  • [NSBundle mainBundle] 详解

    不错的博文 NSBundle介绍 http://blog.sina.com.cn/s/blog_8c87ba3b0100t89v.html 

    大家可以看一下

     

    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";

    当前应用的版本 :

    [[[NSBundlemainBundle] infoDictionaryobjectForKey:@"CFBundleShortVersionString"]]

     

  • 相关阅读:
    探索需求17
    周总结10
    当后端返回的数据格式出问题时
    关于路由的摘记
    element-ui之table——expand,filter和sortable相关方法事件属性等整理
    CSS3 [attribute*=value] 选择器
    判断变量是否为对象(摘自JavaScript入门教程)
    获得去重的数组(摘)
    css的calc() 函数如width: calc(100%
    JavaScript 中 call()、apply()、bind() 的用法(搬运)
  • 原文地址:https://www.cnblogs.com/zander/p/2649129.html
Copyright © 2011-2022 走看看