I have deleted main file from my source file and i got error - ios7

In iOS 7 I have deleted my main file from my source file. I replaced it from trash and I got an error like this:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
how to overcome? Thanks for your help.

When you restored the main.m file did you add it to the bundle? Did you add it with the check mark on copy?
Check in Build Phases under Compile Sources that your main.m file is there.
Also make sure the main file isn't twice in your project.

Related

iWatcher-Prefix.pch.pch: No such file or directory

I have this warning :
while processing /Users/myName/Desktop/myApp/AppRight.framework/AppRight(GrNativeCrashEvent.o):
warning: /Users/gryphonet/workspace/ios/iWatcher/Build/Intermediates/PrecompiledHeaders/iWatcher-Prefix-clslxlldlvbjdmgkugmxtoospkbr/iWatcher-Prefix.pch.pch: No such file or directory
I try this solution but its not work
Why isn't ProjectName-Prefix.pch created automatically in Xcode 6?
And I try to add iWatcher-Prefix.pch.pch file
but still have this warning.

Xcode 6 beta build fails after moving -Bridging-Header objective-c swift xcode6

I am facing build fail error after moving Bridging-Header
objective-c swift on xcode6.
Before I moved header file, it had been working fine.
The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains.
How can clean the objc-header-path?
You need to update the path in your project's Build Settings to point to the new bridging header location.
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
I tried with Xcode6.1-Beta, as well.
But still impossible to update the objective-c header path.
I don't know where the configuration file is. I gave up to figure out.
Finally, I deleted the target xcode project and recreated new project.
Now it is working.
Yes it's possible.
Delete the .h file
Clear the path at Objective-C Bridging Header
Create new Objective-C File
Name your header file to the same name as before (popup will ask you to create new header file)
Goto File > Project Settings > Data Location
Make sure your path is correct and press "Done"
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
Happens to me many times when i move app folder around.
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
Here's what I did to fix this:
Close the workspace
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
In my case, I changed the path from relative path to absolute path and solved.
like
From:
project_name/project_name-Bridging-Header.h
To:
$(SRCROOT)/project_name/project_name-Bridging-Header.h

xcode searches for prefix.pch file in wrong directory

i made a xcode project and changed the name of the folder in xcode as well as in finder. then i proceeded to relink them via the method shown here: Renaming xcode 4 project and the actual folder
so originally the folder was weatherScan2 which i renamed to weatherScan and xcode shows that there are no issues. However when i click build, there's a clang error that says:
no such file or directory: '/Users/user/Documents/Xcode/WeatherScan/WeatherScan2(thisis the folder that i renamed to weatherScan)/WeatherScan-Prefix.pch
clearly it should be looking for the pch file in weatherscan as there is no longer any weatherscan2 folder in existence. How should i redirect this?
i already tried deleting the pch file from xcode and then readding it but the same thing happens. what part of xcode is trying to look for the pch file in the old place and not the new renamed folder? all the other files seems to be working fine.
ok, i realized the issue was in the target/build setting section where it still shows my app looking for the info and pch files in weatherScan2 folder. i edit that and everything works.

Reading File to Frameworks of Xcode

I removed a file from the Framework section of my Xcode application and now I want to add the file back. However when I try to add the file back I get the following alert.
Could not copy /Users/brian/Downloads/iphone-exif-0-9.1(1)/Release-simulator-iphonesimulator/libiphone-exif.a to /Developer/CS193/GraffitiMap/libiphone-exif.a.
What is going on here?
When you add a file in you project, you can either copy it in you project or just reference the file somewhere else on your hard drive.
When you removed the file from you project, you didn't remove it from you project folder. Xcode can't write at that path since there's already a file, and gives you an error.
Just remove the file that's already in your project folder from the Finder.

compilation warning: no rule to process file for architecture i386

How can I resolve this warning?
[WARN]warning: no rule to process file
'$(PROJECT_DIR)/MyApp/MessageCell.h' of type sourcecode.objj.h for
architecture i386
Click on your project, and check that this file is not present in the tab Build Phases. Normally no header files should stay here. Clean and build it again, it should work!
Graphical guide for Xcode 4.x to remove this warning:
http://joytek.blogspot.tw/2011/09/xcode-4-warning-no-rule-to-process-file.html
We can resolve this issue by simply following the steps below:-
Some .md, .mdown .h files are included in the Compile Sources
Step 1) Select Project Navigator
Step 2) Select your project
Step 3) Select your targetStep
Step 4) Select Build PhasesStep
Step 5) Move files which we don't want the compiler to process from Compile Sources to Copy Bundle Resources
Check this
If you are getting this warning from your cocoapod you ned to make sure the s.source_files is set correctly in the .podspec.
For example I originally included all files with this line in my .podspec
s.source_files = "MyUIElements/**/*"
I was getting this compilation warning for some font files I had in the pod. You control which files show up in BuildPhases -> CompileSources on pod consumption like this:
s.source_files = "MyUIElements/**/*.swift", "MyUIElements/**/*.h"
My problem was't header files because under Target > Build Phases > Compile Resources there weren't any .h files to begin with. The system was complaining about some other files. I followed this link which basically said delete the files the system was complaining about but instead I cntrl + dragged them to Copy Bundle Resources.
The easiest way to search for the files is to use the Filter in the upper right hand corner:
Here are the directions from the link: