您的位置:首页 > 其它

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'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: