导入MagicalRecord时单元测试构建失败 [英] Unit Test build failing when importing MagicalRecord

查看:84
本文介绍了导入MagicalRecord时单元测试构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Apple提供的UnitTest模板进行了项目设置。我也将MagicalRecord添加到Prefix标头中。当我在设备和模拟器上运行时,一切正常。
除单元测试外,当我为单元测试编译时,构建失败,并使用以下命令:‘CoreData + MagicalRecord.h’文件未找到

I have a project setup using the UnitTest template provided by Apple. Too I added MagicalRecord to Prefix header. When I am running on the device and Simulator everything is working fine. Except the Unit Tests, when I am compiling for the unit tests the build failed with the following command: 'CoreData+MagicalRecord.h' file not found . This happens in the prefix header.

prefix.pch

prefix.pch

//
// Prefix header for all source files of the '123tv' target in the '123tv' project
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import "Environments.h"
    #import "CoreData+MagicalRecord.h"    
    #import "PBLog.h"
#endif

有人有想法吗?

推荐答案

确保为您的测试目标正确设置了标头搜索路径

Make sure that the Header Search Paths is set up correctly for your test target.

我通常使用 CocoaPods 它将为您自动执行此操作

I generally use CocoaPods which will automate this stuff for you

这篇关于导入MagicalRecord时单元测试构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆