Unit Test build failing when importing MagicalRecord
Asked Answered
H

2

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?

Hitchhike answered 15/4, 2013 at 6:31 Comment(2)
Are the Header Search Paths set up correctly for the test target?Lesleelesley
nope they weren't. Is there a way to automate this? Add your comment as an answer, I will mark it as correct.Hitchhike
L
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

Lesleelesley answered 15/4, 2013 at 12:37 Comment(2)
I'm using cocoapods and I have this same issue.Denesedengue
I've got the same problem. Also using cocoapods.Hybrid
Z
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!

Zing answered 27/5, 2015 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.