可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I load my project from xcode 5 to xcode 6 and see error myProject-prefix.pch is not found in myProjectTests, I add this file and see new error
l
if i load project see in xctest
clang: error: no such file or directory: '/Users/willrock/Desktop/ExtremeFitness/extreme_fitness/extreme_fitness-Prefix.pch' clang: error: no input files Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
but in xcode 5 is work fine
回答1:
- Make new file: +N
- iOS/Mac > Other > PCH File > YourProject-Prefix.pch.
- Make sure you display "All" and not "Basic". (Blue buttons)
- Project > Build Settings > Search: "Prefix Header".
- Under "Apple LLVM 7.0" you will get the Prefix Header key.
- Type file directory. e.g: "$(SRCROOT)/$(PROJECT_NAME)/ProjectName-Prefix.pch".
- Clean project: ++K
- Build project: +B

回答2:
i solved it - in targets delete xctest target and it compiled
回答3:
Try this with Xcode 6. You need to manually create the PCH File.
File -> New -> File -> iOS -> C and C++ -> PCH File.
Add new PCH file to the project - New file > Other > PCH file
At the project 'Build Settings' option - set the value of 'Prefix Header' to your PCH file name, with the project name as prefix - i.e. for project named 'TestProject' and PCH file named 'MyPrefixHeaderFile', add the value 'TestProject/MyPrefixHeaderFile.pch' to the plist.
回答4:
There are a lot of reasons for this issue and I had my own hits.I had to do two steps for my project to run.May be it can be helpful for others.
- I deleted the entry in the Prefix header of Build Settings.
Path-> Target> Build Settings > Prefix Header.
Deleted the Your Project Tests file in the Targets.
screen shot for the second point.
Reference: http://www.buzztouch.com/forum/thread.php?tid=F42D8239A330C321132944A¤tPage=3
回答5:
Generate a new pch file. Name the file as Demo-Prefix.Pch Go to targets - Build Settings
回答6:
Do as follows, changing [Precompile Prefix Header] with [no] and [Prefix Header] with empty field.
And I rebuild the project, it passes, and runs!
[Project] -[Basic] -[Apple LLVM6.1-Language] --[Precompile Prefix Header]-[no] --[Prefix Header]--[]
回答7:
Here is a description what you should do
Click on the first folder under the blue page with the project name. The folder with also have the project name next to it.
File > New File > iOS > Other
Click on PCH File
Click Next
Save As: PrefixHeader
Click the first checkbox under Targets
ONLY; if others are checked, uncheck them
Click Create
If the Prefix Header
" file ended up in a different folder, such as the Supporting Files
folder, move it up to the top folder you clicked on in step 1
Click on the blue page at the top of the left sidebar with the project name next tot it. This is just above the folder you clicked on in step 1
Click on the Build Settings
tab
In the search bar, type in, Prefix Header
and press the Return/Enter
key
Look for Apple LLVM 6.0 or 7.0 - Language.
6.0 refers to Xcode 6 and 7.0 refers to Xcode 7. This makes no difference.
Make sure Increase Sharing of Precompiled Headers
is set to No
and that Precompile Prefix Header
is set to No
Find the Prefix Header
line just under the Precompile Prefix Header
Line. Move the cursor over about 5 inches, but stay on the same line. Double-Click. A box will open.
Type in the name of your project (this is stated next to the folder you clicked on in step 1)
Example) Prereq for Overdue Assignment It is VERY IMPORTANT that you type in capitals where needed such as "P" in "Prereq." It is case sensitive. Now, put in forward slash (/
). Then type in the name of the file you created in steps 2-7 (Again, this is Case Sensitive and you must put spaces where needed). I recommend that you leave the file as PrefixHeader
(no spaces). After the filename, such as PrefixHeader
, type in .pch
ALL lower case.
The final result should look something like this:
Prereq for Overdue Assignment/PrefixHeader.pch
Now, click on the Product
menu (6 menus over from the file menu you clicked on in step 2). Then click on Clean
You can bypass this step by holding command, shift, and K at the same time. Once you get the message, Clean Succeeded,
move on to step 18.
Click on the Product
menu and go down to Build
. Click on Build
.
You can bypass this step by holding command
and B
at the same time. You should get Build Completed.
Thats it!
回答8:
- select your framework in the file navigator
- open the utilities pane (Xcode -> View -> Utilities -> Show File Inspector)
- enable target membership of your framework for all targets.
回答9:
Just change your scheme name to what ever you want.Clear the project then compile it. Its working for me .