您的位置:首页 > 其它

获得IPhone手机的相关硬件和其版本支持的SDK信息

2011-09-05 21:32 288 查看
主要类:UIDevice

例如:如下代码获得了设备是否支持多线程
UIDevice* device = [UIDevice currentDevice];
if ([device respondsToSelector:@selector(isMultitaskingSupported)]) {
_multitaskingSupported = device.multitaskingSupported;
}


再比如:获得设备的ID号:
iphone开发时某些情况我们可能需要获取用户使用的设备唯一编号来做一些事情。

我现在要实现一个验证的过程,但目前为止ios 最新sdk中还没有提供获取用户手机号码的api,所以只有通过获取设备id做验证了,具体代码很简单。

//获取设备id号
UIDevice
*device = [UIDevice currentDevice];
//创建设备对象
NSString
*deviceUID
= [[
NSString
alloc]
initWithString:[device uniqueIdentifier]];
NSLog
(@
"%@"
,deviceUID);
//
输出设备id
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: