有人知道一个好办法吗?

So far I have not found a better way than using File>New file and then copying contents from old file to new.

您可能可以在Finder中复制并重新导入,但工作量几乎相同:切换到Finder,复制,导入新文件.

用一个类来实现这一点并不难,但是如果需要基于超类生成10+个类似的类,该怎么做呢.

在Eclipse中, Select 文件,然后将其复制/粘贴到同一文件夹中.在finder中有重复的.

There's a menu Edit > Duplicate. But it's ALWAYS disabled. I tried selecting various files, classes, methods. It's still disabled.

推荐答案

XCode中的目标启用了"复制"(据我所知,几乎没有其他东西).

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.

这可能是最简单的例子:

http://www.macresearch.org/custom_xcode_templates

否则,我只需在Finder中复制您需要的文件,命名它们,然后将它们整体拖到XCode中.

Objective-c相关问答推荐

UITextField secureTextEntry 带有自定义字体的项目符号?

iPhone SDK 网络连接检测

多个 WKWebView 之间的 Cookie 共享

MKMapView zoom 到 viewDidLoad 上的用户位置?

在 Xcode 中为无法识别的 Select 器创建断点

判断用户是否在连续的 UISlider 上完成滑动?

UIFont 的磅值到底是多少?

无法在 Interface Builder (Xcode 5) 中创建与子视图的出口连接

WKWebView 判断 JavaScript 返回值

如何删除应用程序可访问的所有 keys 串项目?

使用 NSLog 打印 NSData

滑动删除单元格导致 tableView 标题随单元格移动

UICollectionView 仅在用户双击时调用 didSelectItemAtIndexPath,当用户单击时不会调用

iOS ScrollView 需要约束 y 位置或高度

为什么 detailTextLabel 不可见?

`[super viewDidLoad]` 约定

使用 UINavigationController 在 UIPageViewController 中下推内容

使 UILabel 的文本加粗

Apple 说 NSManagedObjectContext 归创建它的线程或队列所有时是什么意思?

Objective C 消息分发机制