project.xcodeproj shows red color, how to resolve this issue
I think you have the merge conflicts in .xcodeproject file.
Click on right mouse button on file
Show package contents
Open project.pbxproj file in the text editor and find all places with
merge comments
as #Erik Godard commented (search for ===== to identify the conflicts)
Remove them
Restart Xcode with your project
Related
I haven't done anything. I just copied into another folder. When I run this code everything is working fine but don't know why some Swift class files are in red colour. Can someone please suggest me a solution?
Just drag this files again in XCode or add reference of those files by clicking on + button on bottom left corner of XCode and then click on 'Add files'.
Import these red colored classes from another folder or backup folder to your current project.
To sort this issue permanently open your project folder and move these classes to main project folder.
I solved this red colour issue by re-adding those class files and i deleted these red colour classes. I Think it's because of the path issue.Solved by readding.
In the middle of coding an app, I wanted to delete a button. What I did not realize was that I was actually selected main.storyboard. When I pressed backspace to delete main.storyboard I pressed "Remove reference". At this point I tried command + z, but ,unfortunately, main.storyboard did not come back.I tried to run the app but I kept getting signal SIGABRT.
My question here is if you accidentally remove the reference to a file is there any way of recovering it?
Only "Remove reference", the file is disappearing only from Xcode and remaining in your real folder. Try to add Main.storyboard again from Xcode file navigator like this.
If you have accidentally removed the reference of a file in your Xcode project (such as main.storyboard or app.delegate) go find the file you removed the reference of in finder. Then drag and drop the file into where all of your files are located in xcode (on the left).
Similarly, if you have trash a file, go into your trash and just drag and drop the project back into xcode.
Hopefully this helps
I'm using Git and we are 2 people coding together. I pulled my friend's code, run it and it worked as it should be. Then I merged our parts and cleaned conflicts (almost all of them were in storyboard). Since i'm doing this merge process for a while, i'm not all stranger for these details.
However, when i run the merged version of code, i get the error:
The document "Main.storyboard" could not be opened. The operation
couldn’t be completed. (com.apple.InterfaceBuilder error -1.)
I can't open storyboard as interface builder either. When i try it, I get the same error. I read previous post about this error but as I mentioned, I can open and run both versions of code in my XCode before merge. Thus, there is not a font or attributed string problem.
What may be the problem?
I got this issue, after I solve the conflicts which is merged by svn.
I could only see the source code of my storyboard, I could not open my storyboard as interface builder. So, after my struggle,
1)I delete the topside space line in my storyboard source code
2)and close my Xcode and simulator
3)restart my project
it becomes regular, oops, the space line on the source code will affect our storyboard !
there are conflicts in Storyboard. You can take last working code of storyboard from github. select storyboard select version editor and copy last working storyboard and replace xml with existing xml.
I guess your storyboard still have confliction.View your storyborad as source code, then fix all conflictions. After all, open it again as Interface builder
For me the only thing that worked was to create a new storyboard file, open the old and the new storyboards as source code, and copy the xml from the old to the new storyboard. I didn't take the whole xml, just the scope of the <scenes> </scenes>
I had to create a new Storyboard file. Then cut and paste the "scenes" tags from the old and put into the new. I then had to delete the old Storyboard from the project in order for the project to build successfully!
I guess the problem is that storyboards don't merge very well, I think it is better to init your UI from code so there will be no troubles during merges. Anyway you should try to rollback and merge it again.
As other mentioned, there are likely merge conflicts in the storyboard file.
If you can't easily solve the conflict by either picking --ours or --theirs, you will have to perform the merge manually in the storyboard file.
What I do is open in in a text editor (e.g., TextEdit.app - but make sure it opens documents as plain text, in Preferences).
Then, locate any occurrence of the git conflict markers (or a portion thereof, e.g., "<<<<<"), and pick the code fragment that you want to leave (and remove the other, of course).
EDIT: As Cong Tran mentioned (and I forgot), you can open storyboards as source code from within Xcode itself (see his answer).
Fast way to fix
Copy the storyboard Id shown on the error prompt window
Right click on your storyboard
Choose Open as => Source Code
Search the id and delete one of the duplicateID and you are done!
i would suggest , right click on any of the files and click on finder then you will have what you need and drag and drop
I had an image in my project which I removed (remove references) due to not needing it.
It transpires that I actually do need it, however now when I try to copy it back I get the following error - even though the image is not in my images folder any more - how is this fixed?
Thanks
Open the folder (in Finder) that your app is contained in. A shortcut is to right click on an object and choose "Show in finder". Once you're in the folder, hunt around for an image named "962-puzzle-piece#2x.png". When you find it, delete it (drag it to the trash).
When you 'remove references', Xcode leaves the image in the project folder, and simply doesn't show it to you. Then when you try to add an image of the same name, it fails because there's already an image by that name in the folder Xcode tries to add it to.
You can avoid this entirely by selecting "Move to Trash" in this dialog when you delete things:
Right click on the folder -> Show in finder.
Then drag the real file to the trash.
Xcode is showing two view controllers, the .h and .m files in red. They're part of a git repository, and I can't seem to be able to access them.
Any help would be greatly appreciated!
Thanks
The files that are in red, are missing from project folder, so delete that red files and again add to the project..
Those files are missing from the project directory. You need to find then and add into project!
Simply 'Delete reference' the red ones, and add again to the project
Check those files in your original source.
Right click on the red file, and you will see the Show in Finder option disabled. That means your original file is deleted from the source.
Either add that file to the path or remove it's reference from your project.