Objective-C Syntax

For a first timer coming from a language like C or PHP, objective C syntax does seem weird, but it takes only a few days to get familiar with it.

The most striking difference in Objective C syntax is the way to call methods. In C or PHP when you call a method of a class through an object its something like this

returnvalue = objectname->methodCallWithTwoParameters(n1,n2);

However in Objective C the call is something like this

returnValue = [objectName methodCallWithParameterOne:n1 parameterTwo:n2];


As you see the parameters are passed in the middle of the method name. The whole call is wrapped with square brackets.