Accidentally imported trash folder into project - macos

I accidentally deleted my index.html file instead of my selected line of code. Dragging the file back into Atom imported the entire .trash folder. I thought, well, I can't take out a root directory, but I've deleted the content within before. I can live with that.
Of course, whatever I deleted came straight back to trash!! Is there any way to fix this or will I have to transfer everything to a new project and burn this one?

Related

Send to Compressed Folder not working properly

I am having a particular issue with Send to Compressed Folder.
What i do is:
Select folder - right click - send to...
Usually it created a zipped file at the bottom of the current with the same name as the folder i wanted to zip. Lately, however, the position of the zipped folder is not the last one in the folder and it automatically makes me rename it.
I know it's a minor issue, but since i deal with lots of zipped folder at work it would be nice to go back as it was.
Thanks in advance!

Accidentally deleted info.plist file under supporting folders: what to do?

I had done a lot of work in a project and when I tried to import a ton of images to put them under supporting folders something in the image files seemed to have caused xcode to start throwing errors and in a panic I accidentally deleted the info.plist file (that comes with a new project by default). This is not a file that I know anything about and I have just taken it for granted so far. Can anyone help me restore it, or do I have to start over? Thanks.
I have done this before. Check the Trash on your computer, it should be in there and re-add it to the project.
I also accidentally deleted my plist file, it wasn't present in trash neither in my repo (I had included it in .gitignore ,which I won't do in future). The thing which worked for me was one copy of this file was present in platforms->ios->en.lproj folder so I copied that file to platforms->ios folder and after that build was successful. Somehow this copy file was not showing in my vscode command pallete as well

Why can't I delete files from my XCode project?

This is probably a very easy question, but I'm having trouble deleting resources from my XCode project. I added them using "Create Folder References for any added folders" so that I could import a whole offline HTML site with its correct folder structure.
Unfortunately, now it has been added like this I don't seem to be able to delete individual files in the structure (it's not available from the Edit menu).
Can anyone help please? Thanks!
That isn't how folder references work. The idea is that its only a reference, you can open files within it and save it from those editors, you can delete or move the entire reference throughout the xcode project, but you can't actually edit it - its read only as far as xcode is concerned. Likewise, you cannot restructure it (move internal files around).
I'm not to sure why apple decided to make this the case, but apparently they have.
If you want to know how one might use the xcode folder system, here's how I tend to use them with my projects:
Whenever I subdivide code into folders, when I drag them into my project I click "recursively create groups for any added folders". If you do this, you any changes you make within xcode will not reflect the actual file itself. As far as I know, there is no way to do this. What does happen then is that when you add a new code file to it, the directory starts off in that file by default. ie, you don't need to navigate to it manually when you create a new file.
I use folder references whenever I'm working with content for an application I'm using. This way, I add all my images, folders, configuration files, whatever - and xcode immediately lists them. The reason I have it within xcode, I can I copy the files into the executables directory by dragging the folder reference into a "Copy Files" build phase.
Thats basically (to my knowledge) how one uses the folder types within xcode - sadly, I don't know how to achieve the functionality you want. You may have to manually delete the folders in finder, which if you do use folder references will update xcode to the change.
I ran into the same issue by using "Create Folder References for any added folders". I wanted to change some of the times but that's not possible. I had added a main folder that had other directories under it. I just had to select the main directory and deleted it and then just add the subdirectories that I needed. You can't make any location or removal changes to the directories that are added this way. -- Jeff
In the project browser, where you're looking at files, right click and choose "Delete". It'll prompt you to either remove the file from the project (leaving the underlying file on the filesystem) or to also move the underlying file to the trash.
I ran into the same issue. Delete the files from the folder directly as opposed to from within Xcode. You'll see the entries turn red under your project. Restarting Xcode should make these red entries vanish.

How do I delete files that are not listed in the project from the hard drive?

I had a big project with a bunch of files I was not using. Little by little, I started removing the references to those files from xcode, until I got the project completely cleaned up.
What I want to do now is to remove all these unused files from my hard drive for good.
Is there an automated way to do this?
Yes, when you delete file from xcode it will give you options like "remove reference only" and "delete".
"remove references only" will just remove the reference in xcode but wont physically delete it from your hard-disk. you can check that practically if you go to the directory which you had mentioned while creating the project and go to the classes directory, you can still see file you had deleted still residing on the hard-disk.
"Delete" will not only remove the references from xcode but it removes the file permanently from the directory where you created your project and you can repeat the same experiment for this case too.
one more way of deleting the file permanently is by using the Terminal.
1- In the finder, in your app project create a sub folder.
2- Put all your project source files into it.
3- Open your project into XCode, all your files will be red (missing).
4- Then little by little, put the good files back at their original place.
5- When all is done, clean all, compile, build, ensure you don't have missing files.
6- If that works, put the sub folder that only contains non used files on an USB key and delete it from the project folder.
7- Remove the USB key.
8- Try again to clean, build, run.
9- If it still works, trash the non needed files.

xcode copying project to another computer

I'm having problems copying a project over from one mac to another. The project compiles and runs fine after being copied, however xcode seems to have some duplicate of the same classes which seem to be invisible on the project browser on the left.
For example if I jump to definition on a variable I get 2 suggestions pop up. The top file when I look at its properties is relative to xcode folder (this is also the one that shows up in the class browser to the left). The second file which cant be seen on the browser has absolute path type in the properties.
Is there any way to get rid of this behaviour so its just looking at one file only like it originally was doing on the other mac? Its a bit problematic as I am never sure which one I am editing and they don't seem to update each other even though they appear to be the same file.
On a side note if I copy the copied project to another location then I get 3 etc files pop up in the jump to definition.
It's usually a good idea to either not copy the "build" folder (or delete it after you've copied everything over - only do this when Xcode is not running though).
Ok so what you need to do is this:
1.Duplicate your project.
2.Open the copy w/the original ,but only the folder.
3.open the Projects files(not the tests the main files)
4.then Drag and drop the files into the xcode area.
5.Zip the folder and its done
its like that because it just removes the references but not the files they are all still there though so just add the references back into the file.

Resources