.pch replacement to put constant file

ProjectName-Prefix.pch is Missing in Xcode 6.

We can create .h file and use #define to create constants and then include this file to prefix file of our project before Xcode 6.

Sample constant.h file

 #define OK @"OK"

Go to View Controller include file in header #import "Constants.h" OR Define in pch file ,so that all View controllers can access the file

In viewDidLoad

NSLog(@"%@",OK);

My question is

where to include my constant.h file so can be access the file from all view controllers like we did using .pch file?

EDIT: My question is replacement of .pch file ? As if apple remove it from Xcode their must be some alternate to achieve this goal without adding .pch and include in every single file to be used

Answers


You answered your question yourself. Here

We can create .h file and use #define to create constants and then include this file to prefix file of our project before Xcode 6.

You include the Common.h file inside the pch file. And you dont have to #import anything, as PCH file is available in all classes, and any import inside the PCH file is also available in all classes. Hence PCH files are termed as Pre-Compiled Header files.


You can configure a pch file in Build Settings->Prefix Header. Type in the path to the pch file or a .h file relative to the xcodeproj file.


Yes You can create header file for Xcode. I am sure pch is best way to used whole application. You can import constant file on pch and used in whole application.


Need Your Help

libpoppler-qt4: How to save form changes

c++ qt pdf poppler

I'm using libpoppler with the included qt bindings to edit forms in a PDF file.