开发者

How do you "speak" a function name to another programmer in objective-c

In c#, if I wanted to tell another programmer to look at a specific function such as Person.GetAge() I would "speak" that functio开发者_如何学Pythonn something like...

"Look at Person dot GetAge"

In objective-c this function is [Person getAge] (there is no "dot"). How do people "speak" this to other developers?


Generally just read it like it's written, with a short pause between the class and method name. For methods like animationDidStop:finished:context: I don't even bother with the colons.


I say it the same as I do in any other language... "person's get age". There is no need for the "dot" as it is simply used to denote what class the member belongs to.


If you follow the naming conventions, the selector is supposed to read much like a sentence. (getAge is a nono)

-[Person age] would just be "Person age" -[UIView animationDidStop:@"anim" finished:YES context:NULL] would be "UIView animation did stop, anim, finished, yes, context, NULL"

You'll also see some with withContext and things like that, to make them even more sentence like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜