Method with multiple input parameters

后端 未结 6 1871
萌比男神i
萌比男神i 2021-02-01 02:11

I understand how to create my own methods that accept input parameters in objective-c but I have never actually created a method with more than one input parameter!

From

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 02:26

    Here's a simple example for Method with parameters.

    - (void)methodName:(NSString *)parameterOne methodNameContinues:(NSString *)parameterTwo;
    

    For Example,

    -(void)showAlertMsg:(NSString *)message withTitle:(NSString *)title;
    

    Here you can see, we've a prefix "withTitle" for the second parameter. We've to proceed the same for the other parameters too.

提交回复
热议问题