How do I pass multiple parameters in Objective-C?

前端 未结 6 1582
感情败类
感情败类 2020-12-02 04:58

I have read several of the post about Objective-C method syntax but I guess I don\'t understand multiple names for a method.

I\'m trying to create a method called

6条回答
  •  伪装坚强ぢ
    2020-12-02 05:26

    Objective-C doesn't have named parameters, so everything on the left side of a colon is part of the method name. For example,

    getBusStops: forTime:
    

    is the name of the method. The name is broken up so it can be more descriptive. You could simply name your method

    getBusStops: :
    

    but that doesn't tell you much about the second parameter.

提交回复
热议问题