iOS如何获取设备相关信息

iOS关于若何获取设备相关信息,APP版本号,电池电量,当前系统名称等。

东西/原料

  • Xcode
  • Mac
  • iPhone

方式/步调

  1. 1

    获取iPhone名称:

    [UIDevice currentDevice].name;

  2. 2

    获取app版本号:

    [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

  3. 3

    获取电池电量:

    [UIDevice currentDevice].batteryLevel;

  4. 4

    获取当前系统名称:

    [UIDevice currentDevice].systemName;

  5. 5

    获取当前系统版本号:

    [UIDevice currentDevice].systemVersion;

  6. 6

    获取UUID:

    [[UIDevice currentDevice] identifierForVendor].UUIDString;

  7. 7

    获取总内存巨细:

    [NSProcessInfo processInfo].physicalMemory;

  8. 8

    获取当前说话:

    NSArray *languageArray = [NSLocale preferredLanguages];

    [languageArray objectAtIndex:0]

  • 发表于 2018-02-28 00:00
  • 阅读 ( 692 )
  • 分类:其他类型

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
admin
admin

0 篇文章

作家榜 »

  1. xiaonan123 189 文章
  2. 汤依妹儿 97 文章
  3. luogf229 46 文章
  4. jy02406749 45 文章
  5. 小凡 34 文章
  6. Daisy萌 32 文章
  7. 我的QQ3117863681 24 文章
  8. 华志健 23 文章

联系我们:uytrv@hotmail.com 问答工具