I’m a noob in objective-c (from C#/Java background), and have difficulty understanding following objective-c syntax, which is used in Picker View control(and also other methods we need to implement for using Picker View):
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row
forComponent:(NSInteger)component
In order to understand, I tried to map it to the following syntax, but seems to be totally different.
-(NSString *)MethodName: (UIPickerView *)FirstParam and:(NSInteger)SecondParam
and:(NSInteger)ThirdParam
Could someone decompose the parts and give some explanation please?
It’s a method named
pickerView:titleForRow:forComponent:It returns a pointer to a
NSString, and requires parameters of types UIPickerView*, NSInteger, and NSInteger.A java-like method declaration might look like this:
NSString pickerViewTitleForRowForComponent(UIPickerView pickerView, NSInteger row, NSInteger component)