- (void)someMethodWithFirstValue:(SomeType)value1 secondValue:(AnotherType)value2;
In this example, value1 and value2 are the names used in the implementation to access the values supplied when the method is called, as if they were variables.
(reference: http://stackoverflow.com/questions/722651/how-do-i-pass-multiple-parameters-in-objective-c)
Objective-C doesn't have named parameters, so everything on the left side of a colon is part of the method name. For example,
- (NSMutableArray *)getBusStops:(NSString *)busStop
forTime:(NSTimeInterval *)timeInterval
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.
My question: Then, how can I call a method?
没有评论:
发表评论