That is OK if you are beginner. See, you can never eat a pizza in one byte, you break it down into small pieces so that you can eat it easily.
The same fact has been realized by Objective-C.
Consider a simple case:
Say we define a method in regular C that takes 5 parameters, and it adds the first two, the result of first and second argument is multiplied with the third argument, whose result is divided by the 4th argument, and at the end, previous result is added into fifth argument.
The following would be the definition of the function:
float aLittleComplexFunction(int first, int second, int third, int fourth, int fifth) {
return ((((float)first + second) * third ) / fourth ) + fifth;
}
Now, note that I couldn't come up with a good function name because it was tough. A function name like addTwoNumbersAndThenMultiplyAndThenDivideAndThenAdd
would be overkill.
Now, when it comes to Objective-C, it breaks down into small pieces as following:
float addNumber:(int)first into:(int)second multiplyWith:(int)third divideWith:(int)fourth addWith:(int)fifth {
return ((((float)first + second) * third ) / fourth ) + fifth;
}
Same is the case with what you have asked. Remember in Objective-C, function name is split, and each part comes with it's relevant parameter, overall making it easier to get to know the actual purpose of the function.
You might feel it difficult to get started with it, but once you do, you'll hate the typical C way.