如何在 Xcode 的自动完成弹出窗口中包含 Doxygen 方法描述? [英] How to include Doxygen method description in Xcode's autocomplete popup?

查看:37
本文介绍了如何在 Xcode 的自动完成弹出窗口中包含 Doxygen 方法描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Xcode ,我想在自动完成选项下方对我的方法进行 Doxygen 描述,例如 alloc:

Using Xcode , I want to have the Doxygen description of my method below the autocomplete option, like alloc:

编写时,Xcode 会显示带有文档注释的自动完成功能.例如,您可以在图像中看到,当从选项中选择 alloc 时,它会显示返回接收类的新实例"以及指向文档的链接.

When writing, Xcode displays the autocomplete with the comments from the documentation. You can see in the image for example, when alloc is selected from the options, it says "Returns a new instance of the receiving class" and also links to the documentation.

例如,我已经能够用 Doxygen 记录我的源代码

I have been able to document my source code with Doxygen, for instance

/** 
 This does nothing
*/
 -(void) doNothing
{
    // This does nothing
}

我在 Doxygen 生成的 HTML 文件中得到了预期的结果,但我不知道如何让这些结果在 Xcode 中显示为建议.

and I get the expected results in the HTML file that Doxygen generates, yet I don't know how to make those results appear as suggestions in Xcode.

推荐答案

大家好消息!Xcode 5 现在内置了对 DOxygen 样式注释的支持.所以,你可以像这样评论你的方法:

Good news everyone! Xcode 5 now has built-in support for DOxygen style comments. So, you can comment your methods like this:

/*!
 * Provides an NSManagedObjectContext singleton appropriate for use on the main 
 * thread. If the context doesn't already exist it is created and bound to the 
 * persistent store coordinator for the application, otherwise the existing 
 * singleton contextis returned.
 * param someParameter You can even add parameters
 * 
eturns The a shared NSManagedObjectContext for the application.
 */
+ (NSManagedObjectContext *)sharedContext;


















这是一个方便的代码片段,您可以添加您的 Xcode 代码片段库以简化方法文档:

Here's a handy code snippet you can add the your Xcode Code Snippet library to make method documentation simple:

/**
 <#description#>
 @param <#parameter#>
 @returns <#retval#>
 @exception <#throws#>
 */

现在,您只需输入doxy"就可以了!你有你的 doxygen 模板.

Now, you can just type "doxy" and poof! You have your doxygen template.

这篇关于如何在 Xcode 的自动完成弹出窗口中包含 Doxygen 方法描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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