在Objective-C中有一种简单的方法可以将方法中的所有参数设置为类的属性吗?类似于setValuesForKeysWithDictionary,但更多的是“setValuesForKeysWithArguments”?
假例子:
@interface SomeClass : NSObject
@property (weak, nonatomic) NSString *foo;
@property (weak, nonatomic) NSString *bar;
- (id)initWithFoo:(NSString *)foo Bar:(NSString *)bar;
@end
@implementation SomeClass
- (id)initWithFoo:(NSString *)foo Bar:(NSString *)bar{
// Mythical implementation begins here
[self setValuesForKeysWithArguments:theArgumentsWeJustPassedToThisMethod];
}
@end