编写一个方法签名,包括文档的类名 [英] Write a method signature including the class name for documentation
问题描述
是否有描述具有类名称的Objective-C方法的语言标准(或常见做法)?假设我有以下伪代码:
class Foo
{
void bar(int i) ;
}
,我想为其编写一些文档。
如果这是Java,我会将方法称为 Foo.bar()
。如果是C ++,我将使用 Foo :: bar
。对于Objective-C,这样做的正确方法是什么?
我知道我可以使用 - (void)bar:(int)i
,但这不包括类(或协议)名称。
通常是 - [Foo bar:]
。当方法是一个类方法时,可能有一个加号而不是减号。
Is there a language standard (or common practice) for describing an Objective-C method with the class name included?
For example, let's say I have the following pseudocode:
class Foo
{
void bar(int i);
}
and I want to write some documentation for it.
If this were Java, I would refer to the method as Foo.bar()
. If it were C++, I would use Foo::bar
. What is the right way to do this for Objective-C?
I know that I can use -(void) bar:(int)i
, but this does not include the class (or protocol) name.
Usually it's -[Foo bar:]
. There may be a plus sign instead of minus when the method is a class method.
这篇关于编写一个方法签名,包括文档的类名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!