#if TARGET_OS_IPHONE //iPhone真机 #elif TARGET_OS_MAC //Mac下 #elif TARGET_IPHONE_SIMULATOR //iPhone模拟器 #endif //结束
pch是对整个项目的预编译
#ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "AppDelegate.h" #endif
#if TARGET_OS_IPHONE //iPhone真机 #elif TARGET_OS_MAC //Mac下 #elif TARGET_IPHONE_SIMULATOR //iPhone模拟器 #endif //结束
#ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "AppDelegate.h" #endif