使用UiDevice获取设备信息 获取设备名称 let name = UIDevice.currentDevice().name 获取设备系统名称 let systemName = UIDevice.currentDevice().systemName 获取系统版本 let systemVersion = UIDevice.currentDevice().systemVersion 获取设备模型 let model = UIDevice.currentDevice().model 获取设备本地模
1.导入代理<NSURLConnectionDataDelegate> @interface ViewController ()<NSURLConnectionDataDelegate> { long long alllength; //下载总长度 long long currlenth; //当期下载长度 } //存放下载的mp3 数据流 @property(nonatomic,strong)NSMutableData *msicDate; //下载进度显示 @property(
这是获取网卡的硬件地址的代码,如果无法编译通过,记得把下面的这几个头文件加上把. #include <sys/socket.h> // Per msqr#include <sys/sysctl.h>#include <net/if.h>#include <net/if_dl.h> #pragma mark MAC addy// Return the local MAC addy// Courtesy of FreeBSD hackers email list