【代码笔记】iOS-判断是否是iPhone5
来源:互联网 发布:公需科目大数据网站 编辑:程序博客网 时间:2024/05/29 15:22
一,代码。
#import "RootViewController.h"// 判断是否是iPhone5#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)]\? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size)\|| CGSizeEqualToSize(CGSizeMake(1136, 640), [[UIScreen mainScreen] currentMode].size) : NO)@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. self.title=@"isIphone5"; //判断是否为iPhone5 NSLog(@"---isIphone5---%i",iPhone5); }- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}
二,输出。
2015-10-19 15:32:46.917 判断是否是iPhone5[9128:228174] ---isIphone5---1
0 0
- 【代码笔记】iOS-判断是否是iPhone5
- ios--笔记--判断当前屏幕是否是iphone5的尺寸
- 判断是否是iPhone5
- 判断设备是否是iphone5
- 判断设备是否是iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- 判断设备是否是iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- 判断设备是否是 iphone5
- iOS宏定义判断是否是iPhone5尺寸
- 【代码笔记】iOS-判断是否是模拟机
- 宏定义判断设备是否是iphone5
- iOS开发笔记- 判断是否是数字
- 安装NTFS For Mac时显示文件已损坏怎么办
- InterlliJ Debug方式启动:Method breakpoints may dramatically slow down debugging
- LeetCode------Lowest Common Ancestor of a Binary Search Tree
- leetcode 8: String to Integer (myAtoi,C库函数atoi模拟) (剑指offer 面试题49) 解题报告
- mysql 赋权笔记
- 【代码笔记】iOS-判断是否是iPhone5
- SDL使用内存像素数据绘制(SDL_CreateRGBSurfaceFrom)
- nrf52832 --- 资料下载
- Android开发中,那些让你相见恨晚的方法、类或接口
- leetcode 226
- iOS开发数据库篇—FMDB数据库队列
- 机器学习实战--决策树
- 父类、静态构造代码块、构造代码块、构造函数
- PHP array_reverse() 函数