21

I recently had to delete a xcode project from my computer and re-clone it down. After cloning it, I ran a pod install and then went to build the project. However, I kept hitting a error in my .pch file that claimed a file (a pod file) was not found.

I looked into the following SO posts:

iOS - Build fails with CocoaPods cannot find header files

Unit Test build failing when importing MagicalRecord

From there I gathered that I needed to add to Header Search Paths the $(inherited) flag. I've done that, I've cleaned the project, and then re-built it, and still am having the following error..

PCH File

Community
  • 1
  • 1
Brian Weinreich
  • 7,692
  • 8
  • 35
  • 59

4 Answers4

48

As of version 2.3.0 (released on 1 June 2015) the file CoreData+MagicalRecord.h seems to have been renamed to MagicalRecord.h only.

If you installed MagicalRecord using CocoaPods and ran pod install or pod update again you might have gotten this new version and will end up with the same error message: CoreData+MagicalRecord.h file not found

So you should change the import of the header in your pch file then. This is what I have now:

MagicalRecord header file change in pch file

Jens
  • 6,243
  • 1
  • 49
  • 79
5

Try to add this line on top of your podfile:

link_with  ['ProjectName', 'ProjectNameTests']

before this line

platform :ios, '8.0'

Install pod, and at your project Build Setting->Other Linker Flags, add $(inherited).

euthimis87
  • 1,134
  • 1
  • 11
  • 18
  • 1
    As a note to anyone else, I started receiving `diff: /../Podfile.lock: No such file or directory` for my ProjectNameTests directory. So, I had to go into Project Deployment Target, click "Info", and under "Configurations" had to set ProjectNameTests to use Pods.debug configuration file – Brian Weinreich Oct 16 '14 at 13:31
0

import "MagicalRecord/MagicalRecord.h"

Community
  • 1
  • 1
Azade Rahmati
  • 135
  • 1
  • 5
-1

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

  1. In your project directory,run pod update

  2. You should now be able to add

#import <MagicalRecord/CoreData+MagicalRecord.h>

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

I think with 2 steps you can be solved this problem.

Cuong Nguyen
  • 980
  • 2
  • 9
  • 29