I am trying to understand the meaning of that “something” before the method name in objC. Here an example:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
The method name is shouldContinueAfterSelectingPerson, the method has three parameter and has a return value (BOOL) but what is the role of peoplePickerNavigationController:(ABPeoplePickerNavigationController *)?
It isn’t the return value, it isn’t the method parameter (because cames before the method name), and so what is it?
In objective c the method is split up into 4 components (or so I would guess as this is how I see it)
I’ll break up this method:
the
-signifies that it’s an instance method, you need to allocate an instance of this class to use it.the
(BOOL)signifies that it should return aBOOL,YESorNO.the method is defined by a selector uid,
peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:That is the full method name unlike what you have said.
the last part are the parameters. Those are pretty self explanatory.