如何清除 Xcode 中 Cocoa 类顶部的所有垃圾?
我看了这里,然后去了 Macmade 说要去的地方。然后,我删除了 File Templates/Cocoa/Objective-C class.xctemplate/NSObject 中两个 FILEBASENAME 文件中 #import 以上的所有内容。然而,我正在 Xcode 中创建从 NSObject 派生的新类,并且我得到了与以前相同的东西。我怎样才能摆脱它?
(我对我不应该摆脱它的可能性持开放态度,但我不相信它至少有用。是吗?)
I looked here, and went where Macmade said to go. I then deleted everything above #import in the two FILEBASENAME files at File Templates/Cocoa/Objective-C class.xctemplate/NSObject. However, I'm creating new classes in Xcode, derived from NSObject, and I'm getting all the same stuff as before. How can I be rid of it?
(I'm open to the possibility that I shouldn't be getting rid of it, but I don't believe it's useful in the least. Is it?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“垃圾”是注释,注释对预处理器、编译器、链接器或用户没有任何影响,因此摆脱它并没有什么坏处。
与文件中的其他所有内容一样,它来自您创建该文件的文件模板。您需要复制您使用的文件模板并从副本中删除注释;然后,您在 Xcode 中通过新模板创建的任何文件中都不会包含任何注释。
我建议您在执行此操作时也删除导入。您的前缀标头应该注意这一点;在其他地方导入系统头应该只是进一步的噪音。
The “junk” is comments, and comments make no difference to the preprocessor, compiler, linker, or user, so there's no harm in getting rid of it.
Like everything else in the file, it comes from the file template you created the file from. You'll need to make copies of the file templates you use and remove the comments from your copies; then, there will be no comments in any files you create in Xcode from the new templates.
I suggest removing the import(s), too, while you're at it. Your prefix header should take care of that; importing system headers anywhere else should be nothing but further noise.