What does the Xcode > File > Project Settings actually do? - xcode

I recently discovered a handy menu item in Xcode.
There is a menu in Xcode 7.0.1 in File > Project Settings. Its content looks like just what I need ie set the Build folder on a per project basis.
It not exactly the same box as in Xcode > Preferences > Locations
However, even if Xcode seems to pick up the new location and compile in it, I don't see anything changed in the project pbxproj (using a git diff).
I want to commit them inside the project and tell the Continuous Integration server to use the same settings as my developement computer.
So my question is: What exactly these settings do (same as the ones found in locations?) and more importantly where are they stored?

Related

How to add json file to Xcode project [duplicate]

I'm trying to add some new resource files to a project which was build by another person on another mac. I think that the project has the provision of the previous person.
Using right click->Add Files to "MyProject" doesn't provide the expected result. After I compile the project, the added file is not visible in the application.
How can I add new resources in my project?
PS: I'm trying to learn Objective-C in a macincloud.com account.
It might be that the file you added was not added to the project build. Click your project > App target > Build Phases
And check that the file exists in Compile sources (if it needs to be compiled), otherwise check Copy bundle resources. If the file does not exist there, drag it there and it should be fine, (from what I understand of your question).
EDIT
You can also check wether a file is added to the target by clicking the file and opening the "File Inspector" (View > Utilities > Show File Inspector, or ⌥ + ⌘ + 1), and check the Target Membership section.
Example:
Adding to Copy bundle resources worked for me
Just drag the resource file (from a finder window) into your project files area (left side) and drop in supporting files.
Once you drop, a dialog will prompt you which targets to add it for. Select all that are appropriate. Thats it.
Just had a similar experience with Xcode Version 11.7 (11E801a), which I mention as it may help others from wasting a day and a half.
In addition to the other answers explaining how to add the resources:
For me the problem was I had my resources listed in Developer Assets under the target's General tab, but also in the Build Phases/Copy Bundle Resources. This worked fine running through Xcode in simulators and even on devices, but when I came to Archive the app, the resources were not being copied. Deleting my resources from the Developer Assets list, but keeping them in Build Phases worked.
And in the end it turns out I only need the resources in the Build Phases section for either running through XCode or Archiving !

Adding resource files to xcode

I'm trying to add some new resource files to a project which was build by another person on another mac. I think that the project has the provision of the previous person.
Using right click->Add Files to "MyProject" doesn't provide the expected result. After I compile the project, the added file is not visible in the application.
How can I add new resources in my project?
PS: I'm trying to learn Objective-C in a macincloud.com account.
It might be that the file you added was not added to the project build. Click your project > App target > Build Phases
And check that the file exists in Compile sources (if it needs to be compiled), otherwise check Copy bundle resources. If the file does not exist there, drag it there and it should be fine, (from what I understand of your question).
EDIT
You can also check wether a file is added to the target by clicking the file and opening the "File Inspector" (View > Utilities > Show File Inspector, or ⌥ + ⌘ + 1), and check the Target Membership section.
Example:
Adding to Copy bundle resources worked for me
Just drag the resource file (from a finder window) into your project files area (left side) and drop in supporting files.
Once you drop, a dialog will prompt you which targets to add it for. Select all that are appropriate. Thats it.
Just had a similar experience with Xcode Version 11.7 (11E801a), which I mention as it may help others from wasting a day and a half.
In addition to the other answers explaining how to add the resources:
For me the problem was I had my resources listed in Developer Assets under the target's General tab, but also in the Build Phases/Copy Bundle Resources. This worked fine running through Xcode in simulators and even on devices, but when I came to Archive the app, the resources were not being copied. Deleting my resources from the Developer Assets list, but keeping them in Build Phases worked.
And in the end it turns out I only need the resources in the Build Phases section for either running through XCode or Archiving !

Xcode: Dragging a Project to a Workspace shows tiny .xcodeproj file in Project Navigator. What's wrong?

Setup:
Xcode 4.3.1 (or 5.x)
OS X 10.7.3
I have reproduced this issue on two separate late-model Macs with this setup.
Steps:
Create a new Mac "Cocoa Application" Xcode Project. File > New > Project… Name it "MyApp".
Create a new Workspace: File > New > Workspace… Name it "MySuite".
Drag MyApp.xcodeproj file from the Finder into the Project Navigator of "MySuite" Workspace.
Expected:
The Project Navigator of the "MySuite" Workspace should now show a full sub-Project for "MyApp" with Source, Targets, etc.
Actual:
"MySuite" Workspace Project Navigator shows a tiny MyApp.xcodeproj item in the Project Navigator. (see screenshots)
Dragging:
Result:
What am I doing wrong in trying to add a Project to a Workspace?
Be sure you don't have the project already open in another window. Xcode only lets you open a project one time. I've made this mistake a lot when working on a framework then trying to add it to an application.
Simply close the project you're trying to drag in's window and everything will be happy.

How to change Xcode build setup without modifying project files?

I would like to know if it is possible to change compile settings without modifying the xcode projects.
Example, adding -Wno-unused-parameter to CFLAGS in such way that it will be used by Xcode when building projects.
This has to work in both case: build made from xcode in GUI or from the console.
If someone asks about why, let's say that the number of projects is quite big and that you may want to alter the options only temporary.
Put the compiler settings you want to change in a configuration settings file. You can create a new one by choosing File > New > New File. The configuration settings file is in the Other group under both iOS and Mac OS X.
To tell an Xcode project to use the configuration settings file, select the project file from the project navigator to open the project editor. Select the project from the left side of the editor. Click the Info button at the top of the editor. You should see a list of build configurations in the editor. Click the disclosure triangle next to a build configuration to have it use a configuration settings file.

XCode 4 Unable to Open Old Projects

I just upgraded to XCode 4 and am now unable to view a number of my previous XCode 3 projects. When I launch the projects XCode opens, but it looks like this:
Any way to tell what is going wrong? Any special logs I can look at? I don't get any warnings or errors appearing!
Had the same problem, resolved:
Right click your project's .xcodeproj file -> 'Show Package Contents' -> delete project.xcworkspace . The workspace file will be automatically recreated when you open the project again.
The alternative solution is to create a new workspace (File -> New -> Workspace) and add your project to it (File -> Add Files to "New Workspace"). Essentially the same thing.
Not sure why the workspace file gets out of sync as I didn't go through any Xcode version changes, but I suspect it was related to git commits. Didn't use .gitignore.
More info on xcworkspace:
project.xcworkspace saves your workspace settings (Navigator/Debug/Utilities panes,etc) and Editor states. It's automatically created when you create a new project.
From a forum - "When you open an xcworkspace file, it opens the associated Xcode project and restores the perspective. Therefore, Xcode workspace files (.xcworkspace) can be used as a wrapper or container for an Xcode project (.xcodeproj)."
The solution was to delete the local project files and re-clone from the GIT repository. Not sure what the issue is, but it may have been related to having opened the project in XCode 4 Developer Preview.
Just cleanup old preferences files from "your_project..xcodeproj" bundle.
In file exlorer right click on "your_project..xcodeproj" -> select Show Package Contents,
and remove all files but "project.pbxproj".
Best regards.
I had the same problem with the zxing ScanTest app. Upgrading to Xcode 4.3.2 solved the issue.

Resources