Xcode looking in wrong folder - objective-c

Xcode 4.2 is looking in my tags folder when I build. This is causing duplicate interface errors, since it believe I have defined classes twice. My folder structure is:
tags
trunk
My current build is in trunk and Xcode is also looking in tags. How can I make it stop doing that?

After editing the pbxproj file, I found references into the other folder. I then removed those files via Xcode and added them back from the correct location. Problem solved.

Related

Moving Project file in Xcode Interface Builder

I have somehow managed to get the Xcode project file for "My System" in a different folder from all the other project files. Everything works but is there an easy way to get the files together in one folder (ie. either by moving "My System.xcodeproj" into the lower folder or moving all the other files up with it in the higher folder.
If I made this change, what parameters I would need to change inside Xcode.
I'm using Xcode 11.3.1 on Mojave and Objective-C (no storyboard).
I'm not sure if it is worth moving these or whether I should just leave it.
File and Folder Structure:
The arrangement shown in your screen shot of the Finder is correct: a project folder, containing the project file (xcodeproj) along with a single folder that contains the actual code files. That is the standard. Don't mess with it.
Actually you shouldn't even look at it. Look at your project through Xcode, and let Xcode worry about where the files "really" are. Under no circumstances should you touch any of these files in the Finder or you will risk breaking the project entirely.

Abc.app unsealed contents are present in the bundle root - Xcode, any change required to bundle?

I have switched my XCode version from 3.2.6 to 5.1.1, I have been asked to change the project settings and porting to a new format and resolved many compilation errors as well.
Now there is no compilation errors i could able to build my project successfully.
When I tries to sign the project using codesign v2 (mac 10.9.5) i could see the following error
"Abc.app unsealed contents are present in the bundle root"
To Resolve I have gone through the below link and tried to create a bundle structure as mentioned in it, but i'm missing something basically I don't know what it is.
Codesign: What are unsealed contents?
My folder Structure would be similar to below, if anyone has seen discrepancy kindly mention what i need to correct.
/src/Abc/
Abc.xcodeproj
build\
doc\
English.proj
Info.plist
Installer.pmdoc
InstallScripts\
Japanese.lproj\
Libraries\
Abc_Prefix.pch
Abc.pmproj
Package\
Resource\
*.png, *.icns, *.jpg, setting.plist
Source\
Uninstall\
zh_TW.lproj\
In my experience, this error message means I've left some files in the same folder level as the Contents folder.
Everything must be inside the Contents folder.
Try moving whatever files are on the same level as the Contents folder to somewhere inside the Contents folder.

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.

Moving .lproj file inside Resources

I'm trying to begin localization on a project, and I've already got an English version of Localizable.strings going. I'm now trying to add French to that file, which is creating an fr.lproj folder, as I'd expect. However, it's putting it in my project root, and I'd like it inside my project's Resources directory.
Xcode seems to have no interest in letting me move the file, and if I move it in Finder, it goes red in Xcode as expected, but doesn't let me click to locate the file.
I've tried moving it in Finder, then editing project.pbxproj in a text editor to add Resources/ in front of the only line in there that mentions fr.lproj/Localizable.strings, and that has worked, but after doing that, the project's targets also turned red in Xcode, and building the app doesn't change that fact. Very odd.. any idea what could be going on, or how to get this going?
This can be a real pain. I even had XCode crash on me when trying to correct unwanted file locations. I found that the best way is to create the localized file (be it .strings or .xib) as a copy of the source language version outside of XCode, then drag and drop it into XCode. If you do this then XCode will display it correctly and your targets' Build Phases > Copy Bundle Resources settings will include it with its correct location. I don't know why your targets are displayed in red, perhaps you could look under Copy Bundle Resources in case anything is wrong there, or also select your project and click Validate Settings in case you haven't already done so.
Also, if you have been testing in the simulator beware of how XCode does not clean up the files in your app bundle--you may want to delete the app and run it again to make sure it's working with your new location.

Why XCode 4.0 Compiler Doesn't Report Line Numbers On Errors?

So, I'm trying to create a cross platform project by having a projects directory for my multiple platforms and a source directory where I will be keeping all of my source files used by the multiple projects.
Something that just came up with XCode is I try to reference a file outside of the XCode projects directory path, a folder path connected by a parent folder, then if there is a compiler error, XCode does not more the specific lines that have an error. Instead, when I clicked the error in the Issue Navigator, it opens the file at the top and the file is devoid of any marks.
Does anyone have any idea how to get XCode to mark up these files properly even though the file is not under the same directory path of the project or workspace?
I know this might seem a little strange or convoluted. I will try and answer any questions about my problem as best as I can.
A work-around is to simply click on the issue in the log navigator. In the log navigator, you get the direct compiler output including line numbers.
It's still very annoying, since issue navigator even fails for many template c++ classes within the project.