Did the way how to globally import files change in Xcode 6 / iOS 8?

后端 未结 3 1647
既然无缘
既然无缘 2020-12-17 23:23

I used to do my global imports (i.e. imports that would be visible to all source files in my Xcode project) in the file AppName-prefix.pch

3条回答
  •  鱼传尺愫
    2020-12-17 23:33

    In Xcode 6 the project's .pch file not anymore generated automatically but if you want one then you can create a .pch file yourself. Do this as below;

    Goto->File->New->File->(Under iOS)Other->PCH File->Next
    

    After entering the name for the file and saving it, go to "Build Settings" and set the insert the value for "prefix header" as "YourProjectName/YourPCHFileName.pch". And if the "Precompile Prefix header" is set to "No" then change it to "Yes". Now you can put any file you want to import globally, but keeping everything here is not a good practice.

提交回复
热议问题