For all intents and purposes, an Objective-C method declaration is
simply a C function that prepends two additional parameters (see
“Messaging” in the Objective-C Runtime Programming Guide ).
Thus, the structure of an Objective-C method declaration differs from the structure of a method that uses named or keyword parameters
in a language like Python, as the following Python example
illustrates:
In this Python example, Thing and NeatMode might be omitted or might have different values when called.
def func(a, b, NeatMode=SuperNeat, Thing=DefaultThing):
pass
What’s the goal of showing this example on an Objective-c related book?
This is a (poor) example of how Objective-C does not support certain features that other languages, (for example, Python) may. The text explains that while Objective-C has “named parameters” of the format
Those parameters do not support defaults values, which Python does.
The mention of prepending two arguments hints at how message passing in Objective-C works under the hood, which is by prepending each method with a receiver object and a selector. You don’t need to know this detail in order to write code in Objective-C, especially at a beginner level, but Apple explains this process here.