如何编辑默认的 Xcode 模板?

发布于 2024-08-02 13:43:50 字数 158 浏览 2 评论 0原文

当我创建 NSObject 子类时,我总是得到一个空的实现。我总是在代码中放入一些东西,例如编译指示和 -dealloc 方法。我更喜欢直接删除不需要的东西,而不是每次需要的时候都从头开始写错字。我几乎总是需要 -dealloc 和 -init,但它们不随默认模板一起提供。有没有办法自定义里面的内容?

When I create an NSObject subclass, I always get an empty implementation. There are some things I always put in my code like pragma marks and -dealloc methods. I prefer to just delete stuff that I don't need over writing it with typos from scratch every time I need it. I need -dealloc and -init almost always, but they don't ship with the default template. Is there a way to customize what's in there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半夏半凉 2024-08-09 13:43:50

看看这篇文章描述了如何在 Xcode 中创建用户定义的模板。

Take a look at this article that describes how to create user defined templates in xcode.

喜爱纠缠 2024-08-09 13:43:50

我还创建了有关如何执行此操作的说明,本教程基于 Xcode 3.2.2 和 3.2.3(撰写本文时为测试版):

http://www.sodeso.nl/?p=895

I've also created a description on how to do this, this tutorial was based on Xcode 3.2.2 and 3.2.3 (beta at the time of writing):

http://www.sodeso.nl/?p=895

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文