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

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.

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.

Qt icons from resource file do not display

I made a user interface using Qt Designer qith Qt 5.0.1, and I used icons from a resource file. After compiling, the executable runs perfectly fine, and the icons are displayed as expected. However, when I run the programme on a different computer, they mysteriously disappear, and I am not able to get them back.
What can be the reason for this? I thought that the resources where hard-coded in the executable after compilation, but that may be wrong. In any case, I find it very peculiar that wherever I move the executable, it displays the icons on my own computer, but not on another one's.
I think you're missing some plugins. If you're using Windows and your icons are .ico type files, you need to copy the qico.dll file from the imageformats folder located somewhere in your Qt folder (something like C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\imageformats) to a subdir called imageformats that you create inside the directory that contains your deployed .exe file.

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.

Intellij Idea problem with text file impossible to read

I have a problem using Intellij Idea.
I am absolutely unable to load text file as InputStream - it doesnt matter where do I put the file (main/java, main/resources...) it just can't find the file - in Eclipse everything works just fine.
I tried setings->compiler->resource patterns and added ?*.txt but that doesn't seem to work either.
Any help is appreciated.
If you load it as a File, make sure that Working Directory is properly set in IDEA Run/Debug Configuration, since it's the default directory where Java will look for a file when you try to access it like new File("file.txt"). Working directory should be set to the directory of your project containing .txt files.
If you load files as a classpath resource, then they should reside somewhere under Source root and will be copied to the classpath according to Settings | Compiler | Resource Patterns.
If you can't get it working, upload your project somewhere including IDEA project files so that we can point to your mistake.
Look at the image, notice that the txt files are in the project root, and not the source folders (in blue).
If you open the Project Structure dialog, and click on Modules and select your module - are the correct folders marked as Source Folders on the sources tab?
Link for how to get to Project Structure dialog
Also, if you print out the absolute path of that file you are trying to read, is that anywhere near where you expect it to be?
An easy way to figure out the same would be to try creating a file in the same fashion and see where it gets created in your project. You can put your input file at the same location and it should work just fine (if it doesn't, you should check your resource pattern which might be causing the file to be not copied over in the build output).
This method actually gives you the working directory of your intellij settings which is pointed out in the accepted answer. Just sharing as I had similar trouble and I figured out this way. :)