使用 Xcode,我希望在自动完成选项下方显示我的方法的 Doxygen 描述,例如 alloc
:
编写时,Xcode 会显示带有文档注释的自动完成功能。例如,您可以在图像中看到,当从选项中选择 alloc
时,它显示“返回接收类的新实例”并且还链接到文档。
例如,我已经能够使用 Doxygen 记录我的源代码
/**
This does nothing
*/
-(void) doNothing
{
// This does nothing
}
我在 Doxygen 生成的 HTML 文件中得到了预期的结果,但我不知道如何让这些结果在 Xcode 中显示为建议。
最佳答案
大家好消息! Xcode 5 现在内置了对 DOxygen 样式注释的支持。因此,您可以像这样评论您的方法:
/*!
* 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
* \returns The a shared NSManagedObjectContext for the application.
*/
+ (NSManagedObjectContext *)sharedContext;
内联帮助如下所示:
快速帮助如下所示:
侧边栏帮助将如下所示:
这是一个方便的代码片段,您可以将其添加到您的 Xcode 代码片段库中以简化方法文档:
/**
<#description#>
@param <#parameter#>
@returns <#retval#>
@exception <#throws#>
*/
现在,您只需输入“doxy”就可以了!你有你的 doxygen 模板。
关于objective-c - 如何在 Xcode 的自动完成弹出窗口中包含 Doxygen 方法描述?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18292155/