https://github.com/facebook/facebook-ios-sdk/blob/master/src/FBAppEvents.h

+ (void)logEvent:(NSString *)eventName
valueToSum:(double)valueToSum
parameters:(NSDictionary *)parameters;

昨天晚上,我去看了下facebook,google的obj-c项目,看下他们是怎么处理多参数方法的,发现他们还是把方法名写成了多个部分,我在想这么做是不是其实还是有些道理的,于是改了下自己的DEMO,看起来顺眼多了

#import <Foundation/Foundation.h>

@interface Employee : NSObject
{
NSString *firstName;
NSString *lastName;
}
@end @implementation Employee //  这里的方法名是 setFirstName:andLastName:
-(void)setFirstName :(NSString *)firstName andLastName:(NSString *)lastName
{
self->firstName = firstName;
self->lastName = lastName;
} -(void)say
{
NSLog(@"HELLO i'm %@ %@",lastName, firstName);
} @end int main(int argc, const char * argv[])
{ @autoreleasepool {
id employee = [Employee new];
[employee setFirstName:@"li" andLastName:@"shujun"];
[employee say]; }
return ;
}
05-07 15:46