I deleted a building dependency by accident, and want to add it back like this:
and I have already checkout it from another git branch as a subfolder of the main project folder, in the subfolder, there is a .xcodeproj there
I google around and some one says that I should drag/drop the .xcodeproj or the entire subfolder to the project explorer, but either works
Here is the subfolder in the main project folder
So how to do that?
Finally, I figured this out:
This thing is called workplace designed to manage multi-project in one Xcode instance
To add a project to the workplace, you should
Open the projectName.workplace instead of projectName.xcodeproj
File -> add Files to "youWorkPlaceName" -> select the projectToadd.xcodeproj and choose what the sh*t options Xcodes give's (if you can understand, this tutorial video will help) and Click add
Then you are ok.
Related
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
If I just drag in the project, all I can see is the project it cannot be expanded, I cannot see the files. Also, is there anyway to copy over existing schemes from the project so that they can be used in the workspace?
First choose file > new > Workspace...
Then, you must first, and this is important, you must first close the project that you want to drag in. Than drag in the .xcodeproj file from the finder to your new workspace. Then it will appear properly and expand to show all of its files and your schemes will be available.
Although the accepted answer is correct, there is an alternate way to accomplish the same thing, and it is arguably easier/more straightforward. You can just open up the project in Xcode and click File -> Save as Workspace...
Bam! You now have a workspace with 1 project in it, as requested.
Just FYI, 2020, Apple recently added a thing,
make your workspace, exit it and
make your new project. in fact when you enter the name to save the project,
they added this option:
just select the workspace you wish to add it to.
Besides all above solutions you can use this alternative. Let's say you have a workspace and a project that you want to add to that workspace.
Close your project.
Open your workspace.
Option + Click in the Project navigator. Make sure you are clicking on an empty area, not on the existing files or folders.
In the context menu, select "Add files to your workspace...".
Finally select your project xcodeproj file on you disk.
Have a nice project 😉,
Add project into workspace
As alternative
- Close a project that you are going to add to a workspace
- Open Project Navigator -> Right click -> Add Files to "<workspace_name>"...
I want to copy some files "Classes" from another project to my current project, but when I run it I get dozen of errors, its seem there are some steps to copying file from one project to another project using Xcode ,
I can make a collection of files "Classes" accessible in my project?
One project is Objective c, the another one seems to be Objective C++
Individual Files
Organize your files
Place the files you will need at a location that is accessible by the Xcode project. Usually, you place these files is a directory below your Xcode project, but that is absolutely not necessary.
Drag & drop
Grab all the files you need and drop them onto your project organizer. You will be prompted with this dialog, to which the settings should look like this (ensure that your target is selected):
Projects
If you want to include a Cocoa Touch Static Library, in the form of an Xcode project, drag & drop will suffice.
No there are not exactly steps we need to follow. Just make sure all dependencies are fulfilled while importing classes from other project. Don't forget to click at checkbox Copy files if needed so that Xcode can make separate copy for your project.
In order to import files in your project click following sequence:
command + option + A
or you can also add files by
Xcode -> File -> Add files to "Project Name"
This is not the first time I've had trouble with this and I suspect not the last time either. Despite having learned many frameworks inside out I still find the organizational structure of a simple xcode project elusive. I simply wanted to retitle a project from CATouchSynth to ABTouchSynth. A while ago I discovered that if you click on the Project folder in project navigator and than change the name in the Identity and Type section it will rename many of the relevant files and directories to the new name. However, there is one main folder inside the folder on your computer that doesn't change and still has the old name. I could see no way to change this folder name through Xcode and so I renamed it manually from finder. This turned all of my source files and assets red so I manually "relinked" them in xcode and they are now non-red and seemingly linked with the newly named folder. However I am getting several compile-time errors talking about the old folder name but I have no clue what Xcode is referring too. The errors look like this
It seemed as if derived data was an issue so I deleted the derived data folder from Xcode and I still get these errors. Has anyone experienced this before and what can I do to ressurrect my project?
Note: Before doing any changes do backup your project folder. This is seriously recommended.
Follow the steps below to rename the source folder of your project –
Close XCode.
Rename the Source Folder.
Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor (Xcode).
This step should be done with extreme caution. Search and replace any occurrence of the original folder name with the new folder name.
Save and Close the file.
Open XCode project.
The error is happening at build time during the compile phase, so you will have to go into the app target's Compile Sources build phase, remove all those .m files, and add them again.
due to working needs, I need to integrate an xcodeproj into my existing project as subproject.
The structure of my two projects is the following
Structure of the two projects
What is the best practice to integrate (no cocoapods) the subProject into my main project?
I have done the following steps as you can see from the picture below:
Integration Steps
I have copied the folder and all the files to my MainProject
folder.
In XCode I have added files to MainProject and then I have choose
the "SubProject.xcodeproj" and I can see the structure in the
project navigator.
I have added into the "Search Header Path" the following sentence:
"${SRCROOT}/../SubProject" with recursive search.
I am not be able to import into my main project the header of the sub project. How can I solve my situation? What I am missing?
Is not clear what you mean with "Integrate a sub project". What to you want achieve? A single target or every project should build a different binary?
First of all I would suggest you to put both project in the same folder, in your example they are both inside the Desktop folder so this is ok.
As second step you should create a workspace, and add both project to this workspace. There is no need of moving folders around, just drag the project icon inside xCode, just below the workspace icon.
Xcode 4 does not automatically add images to the source control (git), also option to add files to source control is disabled in the context menu when I select an image.
Is there something I am doing wrong or will I need to add those files to the repository by some other means.
Thanks
It seems like only way to add those files is from command line via git then Xcode tracks them properly. And I just did that and it works.
Xcode 4 doesn't seem to add any files to the GIT at all with the project navigator "Add files to ..." command, this seems ridiculous.
To demonstrate the problem, simply create an iOS project of any type. Copy a folder of source code into main project folder and then right click the project and select Add Files to . No matter what you select when adding the folder (group/folder) Xcode doesn't add them to the git.
Creating new files within Xcode does add them to the git of course.
Help anyone?