How do you say 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 "say" that the function is something like ...

"Look at Person dot GetAge"

In objective-c, this function is [Person getAge] (no "point"). How do people “say” this to other developers?

+4
source share
3 answers

Usually just read it as it is written, with a small pause between the class name and the method. For methods like animationDidStop:finished:context: I don't even care about colons.

+1
source

I say this the same way as in any other language ... "a person gains age." There is no need for a “dot” because it is simply used to indicate which class a member belongs to.

0
source

If you follow naming conventions, the selector should read as a sentence. (getAge is nono)

- [Person age] will just be "Person age" - [UIView animationDidStop: @ "anim" completed: YES context: NULL] will be "UIView animation has stopped, animation is finished, yes, context, NULL"

You will also see some withContext, etc., to make them even more suitable.

0
source

Source: https://habr.com/ru/post/1315442/


All Articles