PrefixHeader.pch 引入的头文件信息先后顺序很重要
2015-06-29 13:45
483 查看
我在HomeViewController.h中有用到CLLocationManager的类,如果在PrefixHeader.pch中这样写,就可以。
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "Common.h"
#import "LoginViewController.h"
#import "HomeViewController.h"
#import "AFNetworking.h"
#import "RegisterViewController.h"
#import "UIBusListCellTableViewCell.h"
#import "UIBusViewController.h"
#import "QRCodeViewController.h"
#import <AVFoundation/AVFoundation.h>
如果这样:
#import "Common.h"
#import "LoginViewController.h"
#import "HomeViewController.h"
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "AFNetworking.h"
#import "RegisterViewController.h"
#import "UIBusListCellTableViewCell.h"
#import "UIBusViewController.h"
#import "QRCodeViewController.h"
#import <AVFoundation/AVFoundation.h>
把关于定位的头文件放到HomeViewController.h之后,就会报错:
unknown type name 'CLLocationManager'
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "Common.h"
#import "LoginViewController.h"
#import "HomeViewController.h"
#import "AFNetworking.h"
#import "RegisterViewController.h"
#import "UIBusListCellTableViewCell.h"
#import "UIBusViewController.h"
#import "QRCodeViewController.h"
#import <AVFoundation/AVFoundation.h>
如果这样:
#import "Common.h"
#import "LoginViewController.h"
#import "HomeViewController.h"
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "AFNetworking.h"
#import "RegisterViewController.h"
#import "UIBusListCellTableViewCell.h"
#import "UIBusViewController.h"
#import "QRCodeViewController.h"
#import <AVFoundation/AVFoundation.h>
把关于定位的头文件放到HomeViewController.h之后,就会报错:
unknown type name 'CLLocationManager'
相关文章推荐
- 3度带和6度带的区别
- Robot Motion 分类: POJ 2015-06-29 13:45 11人阅读 评论(0) 收藏
- C++关于二进制位操作小结
- Hive配置项的含义详解(5)
- JAVA 毫秒时间转字符显示
- xdebug安装和使用
- html 中文乱码
- ios构造函数
- Android 为LinearLayout增加分割线 divider
- android 录制音频的时候,调用麦克风出停止
- Android旋转本地图片并保存
- Google将不再支持Android Eclipse Tools
- ES6 Features系列:Template Strings & Tagged Template Strings
- 写给过去的自己-No.3-内存管理篇-KL25内存结构浅析
- ContentProvider+ContentObserver实例
- MSSQL - 逻辑主键、业务主键和复合主键
- LeetCode_67---Add Binary
- C#判断用户是否使用微信浏览器,并据此来显示真实内容或二维码
- 视频直播方面的知识ffmpeg
- windows笔记-虚拟内存