I want to duplicate my Xcode project since I need to do a lot of copies with slightly changes, but every time I try o copy it, It lose a lot of Constraints in Storyboard (even some controls disappear), I tried this
Duplicate and rename Xcode project & associated folders
but is in Xcode 4 and is not working for me
EDIT: In my Identity it said that the location is absolute and I can't change it (it is in gray)
Ok first of all its always going to transfer.
So please check to see if the references have been removed and if they have just drag and drop them into the file area.
if it does not work you should copy the files from original project, and use them to create a new file to make up for the missing files.
Hope this helps have a good day! :)
Related
I just saw a weird error on one of my iOS projects.
I'm using Xcode 8 (last release). I have some classes that I share along with other projects. This files are added to the project by reference, in case I need to edit them, I do it just once.
Everything works fine. But I saw that many of this files are on red in one of my projects. The weird thing is that everything works well. All libraries are included, everything runs perfectly. Like I said, the files are marked as red and I can not edit them directly from that project but they are not missing (paths are OK), I cannot go directly to the folder using "show on finder" option.
I tried replacing the folders. Also tried to added and copy them to the project folder. But nothing seems to be working.
I know, there are many threads about this issue but none of them worked for me because my files are not missing.
Did someone see this issue?
PS. I'm using git.
Select the file in the Project navigator on the left, then open the right side Utilities view and select the File inspector. Then click on the little folder icon and make sure that points to the right path.
I have the same problem - definitely not missing files. This is too late for OP but for anyone finding this ... it might help to change the file 'Location' setting from "Relative to Group" to Relative to Project" and then clicking on the folder to reselect the file. It worked for me. I think the path of the group can get messed up.
I would suspect that the files are missing, but Xcode is able to still compile because it's picking up older version from the derived data directories.
I would suggest clearing your derived data to be sure.
the files are marked as red and I can not edit them directly from that project but they are not missing (paths are OK), I cannot go directly to the folder using "show on finder" option
Then the paths are not OK. You need to find these files and add them to the project again. Then delete the red file references.
The given version is described here: How do I rename a project in Xcode 5?
But, as you can see from the following screenshot^, not everything gets renamed, and if one opens package contents, directory names etc. to try to manually change all the references, the project is broken afterwards, so you have to keep the old project name for sub directories etc., which granted is not a massive problem, but is intensely irritating, and I'm not enjoying being intensely irritated at work.
^ apologies for a screenshot, but there's too much information in it to transcribe to written text. Top two-thirds of screenshot is XCode project, bottom third a Finder window.
Renaming projects in xcode in one of the most annoying things in iOS development. I assume you want to rename your app. I faced this problem once and figured out a simple, clean way to do it.
Go back to the point where everything worked.
Open project in xcode and click on the project icon in the project structure( first file)
Go to the info tab
Search for Bundle Name. Most probably it will automatically be set to $(PRODUCT_NAME) which is a shell variable that will set your app name the same as the project name.
Set it to whatever you want your app name to be
Done
Notes :
If you use custom URL Schemes this might produce an error when redirecting.
ALWAYS git or some other SVN in your projects. This will come in handy in this kind of situations
I am working on Xcode 5.0 and with core data. I spend 2 to 3hrs for making relation with tables and those are 2 dozens of table. Now what happened I need those relation for other project also, I copy and paste this to other project both project "xcdatamodeld" file remove and show in red color in compile resource. I don't know why this happen. Kindly guide me if someone already faced this sort of problem. And if there is no chance to recover then also guide me how to add new one. I also made search on whole my mac but didn't find that file.
I am looking for your response. Thanks in advance.
All you need to do is to properly copy the original file of datamodel to the destination project and add it as usual file..that's it.
When adding the file don't forget to tick the checkbox:
Xcode 4.5.2, using cocos2d-iphone 1.0.1 for game development.
Recently, I have realized that every time I replace an image file with one of the same name, the project in my device will continue using the old one when I create a CCSprite with such file.
This can be fixed by simply cleaning the project.
However, now the project is rather large, and compiling after cleaning takes quite an annoying amount of time.
Is it possible to replace files and make Xcode use the correct files instead of having to clean the project?
Another simple fix is to give a different name to the new file and delete the old, then change the CCSprite to use the new file name. Of course, this is ridiculous so I'd like to avoid doing it.
I believe that it also happens even when I just delete the app from the device - it seems I do have to clean the project.
Open Organizer in your Xcode. Goto the Projects tab.
you can see Derived data options. Click Delete near to that option, to clean your project
For some reason my Xcode project doesn't recognize (autocorrect) my code. It doesn't color-code text except for NSStrings (in red). It doesn't autofill things like it used to (e.g. if I would type "CGR" it would put in "CGRectMake:(x,y,width,height)" but not anymore. I don't remember at what point this started happening but it does work in my other projects. Any ideas?
BTW, deleting the derived data doesn't fix it. Nor does creating a new project and importing the files.
this issue has happened to me, I give you 3 sulutions, you can try them.
Solution 1:
Open xcode;
Open Organizer (Xcode-> Window-> Organizer-> Projects)
Select your project and right click, then remove from Organize...
Close xcode and reopen your project.
Solution 2:
Open your project.
Targets -> Building Settings, set Precompile Prefix Header = NOï¼›
repeat solution 1 (Sometimes the Precompile Prefix Header occurs a issue).
Solution 3:
Using commandline.
cd YourProject.xcode
Delete items except project.pbxproj
Good luck.
Hah, figured it out! For some reason my project was split up in different folders. I.E. it was one folder with all the images, another with ViewController.h and another with ViewController.m. Moved all the files to the highest folder in the hierarchy and everything works great :) Thanks for all your help though!
I suppose it would be too easy for your text editing preferences to be wrong? Command-comma -> text editing.