iOS NSBundle(一)

本文展示了如何通过代码读取并解析iOS应用的Info.plist文件,揭示了该文件中包含的关键信息,如版本号、支持平台等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

NSLog(@"plist文件:%@",[[NSBundle mainBundle] infoDictionary]);

plist文件:{

    BuildMachineOSBuild = 15F34;

    CFBundleDevelopmentRegion = en;

    CFBundleExecutable = Test;

    CFBundleIdentifier = "com.laoda.Test";

    CFBundleInfoDictionaryVersion = "6.0";

    CFBundleInfoPlistURL = "Info.plist -- file:///Users/zhangjuntao/Library/Developer/CoreSimulator/Devices/0AD97A8B-25A0-40E2-ACA6-D0343B00B225/data/Containers/Bundle/Application/636D8071-F921-4CC7-8406-DF832A541421/Test.app/";

    CFBundleName = Test;

    CFBundleNumericVersion = 16809984;

    CFBundlePackageType = APPL;

    CFBundleShortVersionString = "1.0";// 这个才是App Store上的版本号

    CFBundleSignature = "????";

    CFBundleSupportedPlatforms =     (

        iPhoneSimulator

    );

    CFBundleVersion = 1;// 这个只是Build版本号

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

    DTPlatformBuild = "";

    DTPlatformName = iphonesimulator;

    DTPlatformVersion = "9.2";

    DTSDKBuild = 13C75;

    DTSDKName = "iphonesimulator9.2";

    DTXcode = 0721;

    DTXcodeBuild = 7C1002;

    LSRequiresIPhoneOS = 1;

    MinimumOSVersion = "9.2";

    UIDeviceFamily =     (

        1

    );

    UILaunchStoryboardName = LaunchScreen;

    UIMainStoryboardFile = Main;

    UIRequiredDeviceCapabilities =     (

        armv7

    );

    UISupportedInterfaceOrientations =     (

        UIInterfaceOrientationPortrait,

        UIInterfaceOrientationLandscapeLeft,

        UIInterfaceOrientationLandscapeRight

    );

}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值