IOS 获取,如电量,CPU,型号等电池信息可以从UIDevice batteryLevel得到,但是只能精确到0.05.- (NSDictionary*)batteryLevel{CFTypeRef blob = IOPSCopyPowerSourcesInfo(); CFArrayRef ...
分类:
移动开发 时间:
2015-01-28 19:29:30
阅读次数:
811
//手机序列号 //NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier]; //NSLog(@"手机序列号: %@",identifierNumber); [[[UIDevice currentD...
分类:
移动开发 时间:
2015-01-26 19:07:05
阅读次数:
157
维护一个程序,当手机升级到ios8之后就不能接收到远程推送,显示注册失败,查了下资料,原来是没有获取用户许可,加了个方法试了下,ok
if ([[[UIDevice currentDevice]systemVersion ]integerValue] >= 8) {
UIUserNotificationSettings*setting = [UIUserNoti...
分类:
移动开发 时间:
2015-01-22 20:17:44
阅读次数:
138
在IOS的APP的应用开发的过程中,有时候需要自动收集用户设备、系统信息、应用信息等等。比如在在app中加入收集用户反馈功能,不仅用户的反馈能够提交到服务器,包括上述信息同时也自动提交到服务器。对用户反馈bug特别有用。下面是他们的获取方法:[cpp]view plaincopy//设备相关信息的获...
分类:
其他好文 时间:
2015-01-17 11:12:03
阅读次数:
134
方法一
首先计算出字符串在已知宽度的View中的size,然后改变View的size就可以。
示例代码如下:
#define IOS7_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
CGSize size;
NSString *strTail = ...
分类:
其他好文 时间:
2015-01-12 16:40:42
阅读次数:
390
强制转成横屏:if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector = NSSelectorFromString(@"setOrientation...
分类:
移动开发 时间:
2015-01-08 12:42:01
阅读次数:
173
概要
IOS获取设备信息一般是通过UIDevice,UIScreen,NSBundle,NSLocal等方式,如果说要获取设备的内存、处理器信息,似乎可以依照Unix获取类似信息方式。
UIDevice提供了多种属性、类函数及状态通知,包括检测电池电量和定位设备与临近感应,UIDevice所做的工作就是为应用程序提供用户及设备的一些信息。UIDevice类还能够收集关于设备的各种具...
分类:
移动开发 时间:
2015-01-06 18:09:36
阅读次数:
129
判断当前设备的系统信息#define isIOS8 ([[[UIDevice currentDevice] systemVersion] hasPrefix:@"8"])iOS8下用下面的方法- (void)setInset:(UITableView *)view cell:(UITableView...
分类:
移动开发 时间:
2014-12-26 12:45:13
阅读次数:
200
-(void)viewWillAppear:(BOOL)animated{ [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"ori...
分类:
其他好文 时间:
2014-12-24 17:47:49
阅读次数:
103
UIDevice类使用内置的orientation属性获取设备的物理方向。IOS设备支持这个属性的7个可能的值。 》UIDeviceOrientationUnknown:方向目前未知。 》UIDeviceOrientationPortrait:Home键在下。 》UIDeviceOrienta...
分类:
移动开发 时间:
2014-12-22 19:16:03
阅读次数:
173