#define NAVIGATIONBAR_HEIGHT 44//navigation bar height
#define SCREEN_WIDTH ([UIScreen mainscreen].bounds.size.width)//Dynamic acquisition of the width of the physical device
#define Screen_height ([UIScreen mainscreen].bounds.size.height)//dynamic acquisition of the height of the physical device
#define SAFE_RELEASE (x) [x RELEASE]; x=Nil//safe release
#define Ios_version [[[Uidevice Currentdevice] systemversion] floatvalue]//Get current device system version
#define CURRENTLANGUAGE ([[Nslocale preferredlanguages] objectatindex:0])//Get the current device language
#define Background_color [Uicolor colorwithred:242.0/255.0 green:236.0/255.0 blue:231.0/255.0 alpha:1.0]//Background color
#define SAFE_DELETE (P) if (p) {[P release], p = Nil;} Safely delete objects
#define COLOR (R, G, B, A) [Uicolor colorwithred:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]//Colour values with RGBA
#define UICOLORFROMRGB (rgbvalue) [Uicolor colorwithred: ((float) ((Rgbvalue & 0xFF0000) >> 16)/255.0 Green: ((float) ((Rgbvalue & 0xff00) >> 8)/255.0 Blue: ((float) (Rgbvalue & 0xFF))/255.0 alpha:1.0] RGB color conversion (16 binary to 10 binary)
#define Clearcolor [Uicolor Clearcolor]//clear background color
#define Alertcontent (content) Uialertview *alert = [[Uialertview alloc] initwithtitle:@ "hint" \
Message:content \
Delegate:nil \
cancelbuttontitle:@ "OK" \
Otherbuttontitles:nil]; \
[Alert show]; \
Warning Box content prompt
#define Degreestoradian (x) (M_PI * (x)/180.0)//angle to radians
#define Radiantodegrees (Radian) (radian*180.0)/(M_PI)//Radian Turn angle
The following three macros are used to determine the device type
#define Isretina ([UIScreen instancesrespondtoselector: @selector (currentmode)]? Cgsizeequaltosize (Cgsizemake (640, 960), [[UIScreen Mainscreen] currentmode].size): NO)
#define IPHONE5 ([UIScreen instancesrespondtoselector: @selector (currentmode)]? Cgsizeequaltosize (Cgsizemake (640, 1136), [[UIScreen Mainscreen] currentmode].size): NO)
#define ISPAD (ui_user_interface_idiom () = = Uiuserinterfaceidiompad)
Common macro definitions for iOS development