TARGET_OS_IPHONE and ApplicationTests

前端 未结 4 1331
我寻月下人不归
我寻月下人不归 2021-01-01 12:35

Why doesn\'t this code work when compiling an ApplicationTests unit test bundle?

#if TARGET_OS_IPHONE
   #import 
   #import &         


        
4条回答
  •  长发绾君心
    2021-01-01 13:11

    I had a similar problem: TARGET_OS_IPHONE isn't defined when building a static library. My solution was to add "-DTARGET_OS_IPHONE" to the "Other C Flags" section of the target build options.

提交回复
热议问题