Example: Objective C method along with php method
I am very used to javascript and php programming and I just switched to Objective C programming. After working with it for a few weeks, the methods still confused me how it goes with parameters, and how methods are named.
Since I'm used to php, I'm used to seeing:
function myFunc($param1, $param2, $param3, $param4) {
return FALSE;
}
Can someone show me how this would be written in Objective C so I can get used to writing methods with parameters?
+2
a source to share
1 answer
-(int) myFuncWithParam1: (int)param1 andParam2: (int)param2 andParam3: (int)param3 andParam4: (int)param4 {
return 0;
}
Basically, this is not a good example, because in Objective-C, signature methods should look more human-friendly and make sense. How [thingamajig panicWithIntensity: 12 andEagerness: 126]
. But you can do it differently, of course.
+4
a source to share