gpt4 book ai didi

ios - 获取操作系统名称(例如 iOS)

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:50:31 29 4
gpt4 key购买 nike

我需要检测设备上运行的操作系统的名称(例如操作系统:iOS)

我在 Objective-C 中需要这个,我该如何实现?

最佳答案

 NSString *strName = [[UIDevice currentDevice] name];  
NSLog(@"%@", strName);//e.g. "My iPhone"

NSString *strSysName = [[UIDevice currentDevice] systemName];
NSLog(@"%@", strSysName);// e.g. @"iOS"

NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];
NSLog(@"%@", strSysVersion);// e.g. @"4.0"

NSString *strModel = [[UIDevice currentDevice] model];
NSLog(@"%@", strModel);// e.g. @"iPhone", @"iPod touch"

NSString *strLocModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"%@", strLocModel);// localized version of model

关于ios - 获取操作系统名称(例如 iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30477680/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com