码迷,mamicode.com
首页 > 移动开发 > 详细

IOS-获取Model(设备型号)、Version(设备版本号)、app(程序版本号)等

时间:2015-07-08 11:14:08      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

    // app名称

    NSString *app_Name1 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

    

    NSString *app_Name = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];

    

    NSString *app_Name2 = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey]];

    

    NSLog(@"==============1%@-----%@---%@",app_Name1,app_Name,app_Name2);

    

    // app版本

    

    NSString *app_Version1 = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey]];

    

    NSString *app_Version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

    NSLog(@"==============1%@---%@",app_Version1,app_Version);

    

    // app build版本

    NSString *app_build1 = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];

    

    NSString *app_build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

    NSLog(@"==============1%@---%@",app_build1,app_build);


    

    //ios获取系统信息

    //NSLog(@"identifier: %@", [[UIDevice currentDevice] identifierForVendor]);

    //NSLog(@"name: %@", [[UIDevice currentDevice] name]);

    //NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);

    //NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);

    //NSLog(@"model: %@", [[UIDevice currentDevice] model]);

    //NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);

        IOS获取IP 参考:http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone

IOS-获取Model(设备型号)、Version(设备版本号)、app(程序版本号)等

标签:

原文地址:http://my.oschina.net/zhengweishan/blog/475933

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!