Anyone know a good solution?
So far I have not found a better way than using File>New file and then copying contents from old file to new.
You can probably duplicate in Finder and re-import but that's almost same amount of work: switching to finder, duplicate, import new files.
Doing this with one class is not so hard, but what to do if you need to generate 10+ similar Classes based on superclass.
In Eclipse you select file and then copy/paste it in same folder. In finder there's Duplicate.
There's a menu Edit > Duplicate. But it's ALWAYS disabled. I tried selecting various files, classes, methods. It's still disabled.
Go to the location of the document you want to duplicate. Right-click the file, and click Open as copy. A new file opens and is named Copy of Document, Document 2, or similar. In the new file that opens, click the File tab, then click Save As.
If you already have Xcode open, head to the Source control menu and click 'Clone'. If not and you are launching Xcode, you can clone a project by clicking on 'Clone' from the welcome screen.
Open "Project Navigator" (Menu View > Navigators > Project ⌘ - command + 1 ). Select Build Phases under your problem target. Open Compile Sources or Copy Bundle Resources section based on your warning. Find the problem files and delete one of them (You should see two files with the same name).
In XCode 4.2 (I know this is an old question) there is Duplicate under the File menu.
Select the file (you can select multiple files but it doesn't appear to do anything useful) in the Project Navigator and then File->Duplicate. Hooray!
In Xcode 4.5 we can duplicate using File-> Duplicate or cmd + shift + S
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With