prefix.pch文件的一些简单使用
生活随笔
收集整理的這篇文章主要介紹了
prefix.pch文件的一些简单使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
該文件可以引入一些全局通用的文件,這樣就不用每次在文件中導入,也可以定義全局通用的變量或常量,如
//定義NSString常量 #define ServiceName @"cn.zmfc" //定義顏色 #define BackgroudColor [UIColor colorWithRed:232/255.0 green:235/255.0 blue:240/255.0 alpha:1.0] //定義IOS系統版本等 #define currentVersion [[UIDevice currentDevice].systemVersion floatValue] #define isIOS8 (currentVersion >= 8.0) #define isIOS7 (!isIOS8 && currentVersion >= 7.0) #define isIOS6 (currentVersion <= 6.0) //定義數組 #define ScatterArray @[@"mega",@"medium",@"small",@"person",@"other"];如對于判斷版本問題,可直接使用。如
if(isIOS8){//要做的事 }?
轉載于:https://www.cnblogs.com/Apologize/p/4332545.html
總結
以上是生活随笔為你收集整理的prefix.pch文件的一些简单使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: I.Mx6 使用串口连接PSAM卡的注意
- 下一篇: 应聘者提问环节