Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode .pch, exclude from one single file

.pch

#ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import "thing.h"
#endif

I have a pretty large project I'm trying to debug and I have a suspicion the problem is in thing.h

From what I understand the .pch file is included in EVERY .m and .h in the project.

Is it possible to have it not included in just one or two files? For debugging I would like to not include thing.h in just one test file, but removing it from the .pch causes a cascading nightmare across the project.

like image 719
user1198665 Avatar asked Sep 19 '13 19:09

user1198665


1 Answers

This is a really old question but I just ran into this issue. I was able to solve the problem by wrapping the pch file with a ifndef SOME_NAME. Then in the project settings on each specific file I wanted it to not be included I added a compiler flag of -DSOME_NAME=1. Hope that helps someone in the future.

like image 79
Micah Wilson Avatar answered Sep 30 '22 17:09

Micah Wilson