1. 用[UIDevice currentDevice].model,这个返回的是一个NSString,你可以做如下判断就能知道设备是iPad还是iPhone. if ([[UIDevice currentDevice].model rangeOfString:@"iPad"].location !
分类:
其他好文 时间:
2016-02-25 13:43:03
阅读次数:
183
//什么是单例? //单例就是单个实例对象,保证对象不管创建多少次,都是唯一一个 //UIScreen UIDevice NSFileManager NSUserDefaults /* 系统单例类: [UIScreen mainScreen] [UIdevice currentDevice] [NS
分类:
其他好文 时间:
2016-02-23 12:57:17
阅读次数:
111
单例模式的意思就是这个类只有一个实例,这个类就是单例类。在iOS中有不少都是单例NSNull,NSFileManager ,UIApplication,NSUserDefaults ,UIDevice,还有一些第三方也有能用到了这种设计模式例如Afhttpmanger。。。 (1)单例模式的作用 :
分类:
移动开发 时间:
2016-02-22 00:10:44
阅读次数:
245
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0) //调用方法 改变PageControl样式 [self changePageControlImage:self.detailPageControl]
分类:
其他好文 时间:
2016-02-22 00:09:44
阅读次数:
284
RecommandViewController *recommandVC = [[RecommandViewController alloc]init]; if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){ recomm
分类:
其他好文 时间:
2016-02-20 17:22:22
阅读次数:
116
原文转自博客-http://blog.sina.com.cn/u/2805226174 IOS7之前,setTintColor是可以修改背景色的,ios7之后修改背景色只能用setBarTintColor。所以要用判断区分开: 1 if ([[UIDevice currentDevice] syst
分类:
其他好文 时间:
2016-02-19 18:56:45
阅读次数:
179
(1)编译正常,运行报 [UIDevice uniqueGlobalDeviceIdentifier]: unrecognized selector sent to此时需要 other linker flags 添加 -all_load参数。 具体:Project ->build settings
分类:
其他好文 时间:
2016-02-08 21:23:17
阅读次数:
237
UiDevice按键与keycode使用
获取坐标与坐标点击
拖拽与滑动
旋转屏幕
灭屏与唤醒屏幕
截图与等待空闲
获取包名&开启通知栏&快速设置&获取布局文件
实例演示
#define DeviceVersion [[UIDevice currentDevice].systemVersion floatValue] if (DeviceVersion >= 9.0) { self.mapView.showsScale = YES; }
分类:
其他好文 时间:
2016-01-28 13:54:51
阅读次数:
164
//自动调节输入文本框的高度 - (void)textViewDidChange:(UITableView *)textView{ float height; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { CGRe
分类:
移动开发 时间:
2016-01-28 10:49:58
阅读次数:
189