I read many definitions of the # if and # define operator.
I tried to use the reading method, but only with the error " Invalid token at the beginning of the preprocessor expression " in the line that defines it as a comment below:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define is_ipad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define is_ipad_hd ( (is_ipad == 1 && [UIScreen mainScreen].bounds.size.width > 1024 ) ? YES : NO)
#define is_iphone_hd ([UIScreen mainScreen].bounds.size.width > 480 ? YES : NO)
#define device_width 480.0f
#define device_height 320.0f
#if (is_ipad_hd == YES)
#define device_width = 2048.0f
#define device_height = 1496.0f
#endif
Why does this work in simple tutorials, and when we try to do something more complex, it happens!
source
share