[IOS]添加预编译文件(.pch)
2015-11-03 12:01
417 查看
[IOS]添加预编译文件(.pch)
1.创建pch文件(iOS - Other - PCH File)
2.工程配置设置(Build Settings - Apple LLVM xx Language - Prefix Header)
添加内容:$(SRCROOT)/项目名/***.pch
例如:$(SRCROOT)/DMPrefixHeader/DMPrefixHeader.pch
上面这种方式在Swift项目中没法使用PCH,需要对另一个参数进行设置(Build Settings - Swift Compiler Code Generation
- Bridging Header)
用OC创建的项目:
用Swift创建的项目:
3.在预编译过程中定义内容,之后便能在程序中不用引入头文件就能调用这些定义的内容了
1.创建pch文件(iOS - Other - PCH File)
2.工程配置设置(Build Settings - Apple LLVM xx Language - Prefix Header)
添加内容:$(SRCROOT)/项目名/***.pch
例如:$(SRCROOT)/DMPrefixHeader/DMPrefixHeader.pch
上面这种方式在Swift项目中没法使用PCH,需要对另一个参数进行设置(Build Settings - Swift Compiler Code Generation
- Bridging Header)
用OC创建的项目:
用Swift创建的项目:
3.在预编译过程中定义内容,之后便能在程序中不用引入头文件就能调用这些定义的内容了
#ifndef DMPrefixHeader_pch #define DMPrefixHeader_pch // Include any system framework and library headers here that should be included in all compilation units. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. #endif /* DMPrefixHeader_pch */ #define DMNUMBER @"12345678"
相关文章推荐
- IOS开发: 使用Block在两个界面之间传值(Block高级用法:Block传值)
- iOS 优秀博客
- iOS 获取验证码倒计时
- IOS学习之AFNetworking 使用总结 (用法+JSON解析)
- iOS开发中 自定义TabBar
- GitHub上值得关注的iOS开源项目
- ios系统地图无法定位问题
- iOS 容易引“起循环引用”的三种场景
- iOS开发笔记--导致EXC_BAD_ACCESS问题的原因
- IOS CoreData
- 2015-11-3 IOS 开发者账号申请
- ios 字号问题
- 【iOS】汉字数组,按首字母排序
- iOS视图生命周期
- xcode7.1不能运行ios7模拟器问题
- iOS: ARC和非ARC下使用Block属性的问题
- iOS实现多个异步线程同步的操作
- iOS判断CLLocationCoordinate2D对象是否可用
- ios开发遇到的44高度,和64 高度问题
- iOS 应用逆向工程(三)