#define IS_IPAD (UI_USER_INTERFACE_IdioM() == UIUserInterfaceIdiomPad)
2. iOS版本判断
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_5_1
[navigationController.navigationbar addSubvIEw:imageVIEw];
#else
[navigationController.navigationbar insertSubvIEw:imageVIEw atIndex:0];
#endif
3. 自定log 调试用
#define showLogInfo 1
#if showLogInfo
# define DLog(...) NSLog(__VA_ARGS__)
#else
# define DLog(...)
#endif
4. 各目录路径获取
OC代码 // 获取沙盒主目录路径 Nsstring *homeDir = NSHomeDirectory(); // 获取documents目录路径 NSArray *paths = NSSearchPathForDirectorIEsInDomains(NSdocumentDirectory, NSUserDomainMask, YES); Nsstring *docDir = [paths objectAtIndex:0]; // 获取Caches目录路径 NSArray *paths = NSSearchPathForDirectorIEsInDomains(NSCachesDirectory,250); line-height:18px"> Nsstring *cachesDir = [paths objectAtIndex:0]; // 获取tmp目录路径 Nsstring *tmpDir = NstemporaryDirectory(); 总结
以上是内存溢出为你收集整理的判断ios设备版本号,是否为iPad全部内容,希望文章能够帮你解决判断ios设备版本号,是否为iPad所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)