I need to import this header
#import "NumberKeypadDecimalPoint.h"
But only if the device its an iPhone. How could i do this?
The app its universal
I try this but it doesn’t work
#define iPad UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
#if iPad
#import "NumberKeypadDecimalPoint.h"
#end
Thanks
You can’t do that. To understand why, you have to have some understanding of how universal apps (and the C compiler) work.
First,
#if,#defineand the like are precompiler macros that are invoked early in the compilation stage. They are normally used for writing portable code that can be compiled across platforms. For example:However, universal apps are just that – binaries that are runnable on multiple device types. Because of this, the code run on iPhone and iPad are produced by the same compilation pass (this differs from universal binaries or fat binaries that were used to support multiple CPU types in one app, those apps actually did contain code from multiple compiler passes in one app binary).
Since your device type can only be determined in run time, you have to perform the device type check in run time.