是否有一些替代方法可以在objective-c中记录您自己的函数/方法/变量? 与C#中的XML文档和Java中的Java doc一样。
答案 0 :(得分:2)
我建议你使用Doxygen。这是我们在工作中内部使用的,它运作得非常好。如果你最终需要这个系统,那么你可以将同一系统用于其他语言也是一个额外的好处。
有一个很好的指南可以自动生成您的构建Doxygen文档:http://www.guidebee.biz/forum/viewthread.php?tid=168
答案 1 :(得分:2)
答案 2 :(得分:1)
我有deja vu ;-)无论如何,看起来Doxygen可以handle Objective-C as well;我没有亲自尝试过。
答案 3 :(得分:0)
大家好消息! 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 Code Snippet库以简化方法文档:
/**
<#description#>
@param <#parameter#>
@returns <#retval#>
@exception <#throws#>
*/
现在,你可以输入“doxy”和poof!你有你的doxygen模板。