2

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 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

Has anyone an idea?

btype
  • 1,593
  • 19
  • 32

2 Answers2

2

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

I generally use CocoaPods which will automate this stuff for you

Paul.s
  • 38,494
  • 5
  • 70
  • 88
0

Try to run command (1) in terminal, then add import in step (2)

  1. In your project directory

run pod update

  1. You should now be able to add

#import <MagicalRecord/CoreData+MagicalRecord.h>

to any of your target's source files and begin using MagicalRecord!

Cuong Nguyen
  • 980
  • 2
  • 9
  • 29