开发者

Objective C - Excluding imports when on simulator

开发者 https://www.devze.com 2023-03-23 21:15 出处:网络
Is there a way I tell my code to import certain libraries only when it is being compiled to a device?

Is there a way I tell my code to import certain libraries only when it is being compiled to a device?

Something like this in the .h file

if (device) {
    #import "Lib1.h"
}

Having issue compiling t开发者_StackOverflowo a simulator with that specific class but works on a device.

Thanks,

Tee


You want to check whether or not TARGET_IPHONE_SIMULATOR is true during compilation.

#if !(TARGET_IPHONE_SIMULATOR)
#import "Lib1.h"
#endif
0

精彩评论

暂无评论...
验证码 换一张
取 消