Xcode 简化实现文件中的文档
我在接口文件中记录我的方法,如下所示:Xcode 简化实现文件中的文档,xcode,Xcode,我在接口文件中记录我的方法,如下所示: /** Returns an foo object containing a new bar value. @param newBar The bar value for the new foo. (Possible values: foo or bar) @return A foo object containing a calculated value. You can specify bar values in the followin
/**
Returns an foo object containing a new bar value.
@param newBar The bar value for the new foo. (Possible values: foo or bar)
@return A foo object containing a calculated value.
You can specify bar values in the following formats `bar`, `foo`.
*/
当使用alt单击方法名时,Xcode会生成一个很好的小弹出窗口
为了在我的私有方法中实现这一点,我在.m文件的顶部添加了一个@interface
。我在其中声明并记录我的方法。这是可行的,但是它a)将我的文档与方法的实际实现分开,b)在快速跳转菜单(代码窗格上方)中显示,因为我的所有文档化方法都显示两次(一次是从斜体的@界面中显示,一次是从@实现中显示)
有更好的方法吗?如果我在@implementation Xcode中记录了该方法,则该方法似乎不会生成弹出信息。您可以使用额外的头,如果您的类是接口
,则它可以是接口Private.h
在此新标题上定义并记录您的私有方法和属性。文档按预期工作,您将在跳转栏中看到杂乱无章的内容
它不能解决与实现问题分离的文档问题。我不明白为什么这是一个问题,每个人都希望文档在头文件中
在一个单独的头文件中有一些私有方法是很方便的,有时候,在hackish子类中