I edited an existing project in Xcode and added a folder in it. In that folder, I placed 2 folders. And created a cocoa touch class in both of them. Now, when I look in to the directory of my project. My classes are not inside the folder, where they're expected.
It should be located in
Screens -> MyView -> View1 & View 2
But instead it is in the Screens folder
On Xcode, it is properly located but when I open the root folder of the project it isn't. How to fix this issue?
Xcode itself does not create any folders for you on your mac.
You have to create the folder structure manually on your mac. Then move the files to the new location.
Next delete them out of Xcode then drag and drop the files from your mac folder to the virtual folders within Xcode.
You will have to create folders manually in your project. Adding files to XCode group does not reflect to your project folder structure. Just remove reference of the existing files from your XCode and then move the required files into your desired folder and add them back to your XCode Project. Hope this will help you.
Related
I have changed the name of two folders of an XCode project and when I open this project, it doesn't work anymore (XCode can't find the files where the name of the folders were changed). I know it's a little issue and I have tried to find where to update the references to these particular folders in XCode but couldn't find how to.
I have changed where it is written "NewName"
Can you help me to solve that ?
Thanks
Blue Folders in Xcode are physical folders on disk in the project folder.
Navigate to the project folder in Finder by right-clicking on a valid item in the side bar > Show in Finder, quit Xcode, rename the folders in Finder accordingly and reopen the project.
Then check the Build Settings of the target if there are any path references using the old folder names and change them, too.
I have an Xcode project. I see that there is a folder within the project folder in my Finder with exactly the same name as the project folder and this folder contains a copy of the project and includes, you guessed it, a copy of the project within again and again. The project folder is now 5Gb while the app itself is no more than 25Mb. So I think that the project somehow is making copies of itself. I see that in my Project I have two targets, one of the project name and one with the project name + "- copy" at the end of the target name.
I wonder what I should do to stop my project increasing in size and how to safely remove the copied project folder within.
there was a copy of the project in the target, the solution is to remove the offending folder form within the project in finder and then to remove the copied project in the target.
I'm trying to copy/paste my XCode project in an other folder of my Mac but when I open it in the new folder, all the files are in red like there was not in the project.
But the files are in the good arborescence of the project.
I already try to delete them and add them but it still doesn't work :/
You have only the reference now! delete those files and drag them to the project again, while doing so, please select the "copy items to destination folder" option
I deleted it out of the folder view in the left sidebar. It's gone from inside the apps folder and it isn't in the trash. It isn't letting me undo inside xcode either. It's a phonegap project and I deleted the 'www' folder.
Normally, the folders in XCode do not represent real folders in your filesystem.
Did the folder contain certain files? Can you check if these files are still present in the root of your project folder (via finder)?
If yes, the simplest way would be to just create a new folder an drag the files into it again.
I hope you have a backup. Xcode 4 deletes the files directly, rather than moving them to the trash. Please, file a bug report about this at bugreport.apple.com!
How can I move source files physically from one folder to another, and tell Xcode 4.2 the new path to those files?
See The Xcode hierarchy is a purely visual organization system. It has no effect on your actual file hierarchy. Xcode leaves the actual file system up to you.
Thus, you could, if you wanted to, have one folder on disk with all your source files, resources, etc. And then, in Xcode, you could have an elaborately organized hierarchy to display your source files.
To get your things done first Make a copy of files in desired directory. Then remove all those files from the Xcode Project. Then add the existing files from new directory and this way you can get Xcode to link to new directory.
Let me know if this helps.
Thanks
Thank you for your solution.
I created aproject X and later on, a view controller with 2 files XViewController.h and XViewController.m inside this project. Those files (by some mistake) were not created inside the physical+xcodevirtual project folder X, but in the root folder that contained X.
When I moved those files from inside Xcode to the X folder, the files seem that they moved there under X and they showed up there in the project hierarchy.
However, this way I ended up with 2 physical copies of them, on at the same level as X physical folder, and another under X.
After adding a property in the XViewController.h and build the project I noticed that my change did not work, and the Xcode reported the error that there was no such property inside the XViewController class and in the .h file.
Using "Show in finder" option I found the real file. Then I copied the updated physical files under X physical folder and delete the files that were in the same directory level as X. That way the Xcode project references to these files became red, implying that the virtual environment had lost the files. So, I completely deleted them from inside Xcode.
Then using File --> "Add Files to X..." menu option I re-connect the "good" physical files to my project X, and this messing problem was solved.