你如何在XCode中复制文件? [英] How do you duplicate a file in XCode?

查看:1727
本文介绍了你如何在XCode中复制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道一个好的解决方案吗?



到目前为止,我还没有找到比使用文件>新文件然后将内容从旧文件复制到新文件更好的方法。 / p>

你可以在Finder中复制并重新导入,但这几乎是相同的工作量:切换到finder,复制,导入新文件。



对一个类执行此操作并不是很难,但如果需要基于超类生成10个以上类似的类,该怎么办。



In Eclipse您选择文件,然后将其复制/粘贴到同一文件夹中。在finder中有重复。



有一个菜单Edit> Duplicate。但它总是被禁用。我尝试选择各种文件,类,方法。它仍然被禁用。

解决方案

为XCode中的目标启用了Duplicate(几乎没有其他我知道的)。



如果您有大量具有相同起点的子类进行复制,为什么不从中创建一个类模板?然后你可以使用file-> New来创建新实例。这是相当快的。



这可能是最简单的例子:



http://www.macresearch.org/custom_xcode_templates



否则,我d只需根据需要复制Finder中的文件,命名它们,然后将它们拖放到XCode中。


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.

解决方案

"Duplicate" is enabled for targets in XCode (pretty much nothing else that I know of).

If you have a substantial number of subclasses with the same starting point to replicate, why not make a class template from it? Then you can just use file->New to make new instances. It's fairly quick to do.

This is probably the simplest example:

http://www.macresearch.org/custom_xcode_templates

Otherwise, I'd simply duplicate the files in Finder as many times as you need, name them, and drag them into XCode en-masse.

这篇关于你如何在XCode中复制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆