View Controller Keeps Disappearing - xcode

Whenever I close Xcode and then open it again, some file gets deleted and I have to start all over again. When I checked the file status it says locally deleted. Is there a way I can fix this :
Thanks

There is a possibility that your 'red' files (classes) are not at the same location as they were the last time you opened the project.
Find the files which were red, add them back to your project, and
delete the red links. Assuming, that you haven't deleted them by
mistake. (in case you did accidently - here's a hack)
Check the full path of the missing file or 'Show in Finder'. Can you access it?
If this doesn't help, I found this useful thread when I was using Xcode 4.1 earlier. Check it.

Related

Simulator LaunchServicesError error 0. - rename folder fixes it?

Suddenly I've started to get this error LaunchServiceError
If I rename the main folder say from ProjectA to ProjectB
then the LaunchServiceError goes away, as soon as I name it back to the original folder name, the error returns.
Any ideas please?
Based on the error my guess is that you're not opening Xcode Instruments in the recommended ways:
https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/LaunchingInstruments.html
Basically always make sure you launch it through Xcode (or an Xcode application menu by right clicking on the Xcode icon, etc). As well, make sure to always save your .trace file using Save As in Instruments, so that you can ensure it's saved with a unique name.

Accidentally deleted file in Xcode

I accidentally had one of my files selected in a project in Xcode and pushed delete and it was deleted. Anyone know how to recover it? It won't let me undo. Please help.
The file itself is not deleted, it is simply removed from the Project Navigator.
To add it back, go to
File -> Add files to "projectName"
and select the missing file, after having navigated to the project's folder if needed.
Or simply hit cmd+z
May be its too late but for someone else it might be good to know, that's why I am answering it.
Go to File >>> Add Files'Your Project Name' there will be a list of all files which have been removed from project, select and add them back.
Now these files are back in project, but they don't have any reference yet so xCode will give you error saying "Storyboard do not have any file of this name", now you have to add references, for this just right click on that missing files and add that file to project.
NOTE: If you have removed files directly to trash then restore from trash and repeat second step to add reference back in project.
This file should be in the trash folder, look in that folder or you can search via apple spotlight.
The following steps will allow you to recover (a) deleted file(s):
Click on the trash icon on the bottom right
Search for the file(s) and move it back into your project folder
In XCode, go to File, Add Files to ..., then select the file(s) you've just restored
There are some files that XCode deletes utterly without warning. These files are permanently deleted unless you have a backup.

Multiple errors ocurred while copying files - but, can I see what they are?

There were around 200 files I had to delete in my Xcode project (and yeah, they were deleted properly), and now I have to copy 200+ files are supposedly replace the ones I just deleted.
I keep getting "Multiple errors occurred while copying files". The Xcode window doesn't show the newly-added files, but if I explore the project folder using the Finder, I can see that the files were indeed added - well, there most likely was a certain file that could not be copied and thus caused the error. Problem is, I have no idea which one nor why.
Now then, is it possible to get Xcode to tell me what the problem is rather than telling me there is one?
Edit: Okay, I did discover that some of the new files shared the same name as some files that were not listed in Xcode, which explains the error. However, I am still interested in knowing whether there is a way to know that the "Multiple errors" actually are whenever Xcode says t his.
When Xcode finds a duplicate file, it generates this error, and then it fails to add references for the files that it did manage to copy.
Rather than deleting files from the finder and starting over, you can do this:
Open the Finder for your project, where your source files are located
Command-click the ones for which your references are missing (and if you click others, it won't really matter)
Drag them into Xcode. When the confirmation dialog comes up, unset the "Copy items into destination group's folder (if needed)" checkbox. This will tell Xcode to make references only.
I deleted the files from finder and then added again the files via Xcode, that worked for me.
This error sometimes occurs when the code is not merged properly. The missing files will not be available in Xcode but once you open the finder containing this project, you will be able to spot the missing file.
The simplest way to add these missing files back to the project is:
1) In your Xcode, navigate to Build Phases Tab.
2) Under Compile Sources, tap on '+' to add back the missing file.
Sometimes the missing files will be greyed out in the build phases, just tap on '-' and add them back.
For me this is worked. I tried to add files which are already in my bundle. So make sure you are not adding files which are already added. I hope it helps someone.

Xcode 4 shows no files after loading project

I've loaded a project in Xcode 4 after not looking at it for a while. Xcode shows its progress bar and indicates in text that the project is loading, and it appears to finish, but then there are no files shown in the hierarchy or flat views. There is nothing showing in any view (except for one breakpoint in the breakpoints view).
Any ideas? Xcode gives me zero indication that anything is wrong, it shows me nothing.
I just had the same issue. After a few hours scratching my head and trying all kind of things, I finally found a fix: remove the whole package 'project.xcworkspace' inside the XXXXX.xcodeproj package.
More specifically, when you find the 'XXXXX.xcodeproj' file, right-click it, and select 'Show Package Contents'. This will get you inside the package where you will find the 'package.xcworkspace' file. It is best to do this while the Xcode project is closed.
Maybe that will work for you or for others with the same issue in the future...
Some of the project views have the "Recently Changed" filter icon. For me the problem was: i had that enabled in the Project Navigator, so it was only showing the files i recently changed. It looks like this.
I'm using Xcode 6.1 though.
I had a similar issue. After archiving a project the files would disappear from the project navigator.
It turned out that somehow XCode had added the word "main" to the searchbar below the project navigator so that almost all files where invisible. Quite frustrating.
It might be the same case for you..
For those who make it here, I was opening a older version of a similar iOS project after upgrading to the latest XCode (6.2), and was seeing the symptoms labeled in this question (missing files, folders etc.)
My solution: at the bottom left of the screen, unselecting 'Show only files with source-control status" which happened to be set on (it's blue when on). The icon looks like a 4-pt star inside a square.
remove the whole package 'project.xcworkspace' inside the XXXXX.xcodeproj package. may cause to any other error so please ignore and trying finally
You can quit xcode and reload again your project it help you
This happened to me when I tried to do an alt-tab, on a VM running in TeamViewer in Windows - Click the search bar below, enter delete multiple times and the invisible search term cleared up
I had the same issue. Besides the answers above, it could also be that you have already accidentally opened the project in another Xcode window... Close that and reopen everything and it should work.

Why does vwd.webinfo always get automatically checked out from source control?

We have a 2008 solution that has a file system website as part of the solution. This solution is under source control with Team Foundation Server. Every time the solution is closed it either checks out a file called vwd.webinfo or attempts to and complains that someone else already has it checked out.
Removing the file from source control does not fix the issue because it gets re-added automatically for some reason.
Why does this happen and is there something we can do about it to remove this nag?
Thanks a lot!
open "source control explorer"
find vwd.webinfo in the correct path
click "delete"
chek-in the operation to solve this problem
The file will still be in your file system and solution, but not under source-control. You won't see "plus" or "v" or "lock" button
Go to Property Pages, select Build on the left, and uncheck "Build Web site as part of solution" Then you can delete the file and it won't get created automatically.
You should be able to delete this file manually and have it not reappear. This file holds some information that used to be located elsewhere in the project in earlier versions but apparently is not necessary. Close your solution before deleting the file from source control and on the disk.

Resources