我从sudzC获得了以下生成的代码,生成的代码显示错误。我纠正了一些错误,现在进入下面的代码行。
.h文件
- (SoapRequest*) CreateAdvocacyData: (id) target action: (SEL) action oNode: (nil) oNode;
.m文件
- (SoapRequest*) CreateAdvocacyData: (id) _target action: (SEL) _action oNode: (nil) oNode
{
NSMutableArray* _params = [NSMutableArray array];
[_params addObject: [[[SoapParameter alloc] initWithValue: oNode forName: @"oNode"] autorelease]];
NSString* _envelope = [Soap createEnvelope: @"CreateAdvocacyData" forNamespace: self.namespace withParameters: _params withHeaders: self.headers];
SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"http://www.avectra.com/2005/CreateAdvocacyData" postData: _envelope deserializeTo: nil];
[_request send];
return _request;
}
从其他文件调用
[service CreateAdvocacyData:self action:@selector(CreateAdvocacyDataHandler:) oNode: [[ alloc] init]];
这些都是由sudzc生成的代码。 我怀疑:
请建议我修改这行代码。
请解释一下的含义
action:@selector(CreateAdvocacyDataHandler:)
我可以传入oNode:nil而不是[[alloc] init](错误)。
答案 0 :(得分:0)
生成的代码中存在一些问题,我对其进行了更正(来自sudzc.com)。
- (SoapRequest*) CreateAdvocacyData: (id) target action: (SEL) action oNode: (nil) oNode;
修改为
- (SoapRequest*) CreateAdvocacyData: (id) target action: (SEL) action oNode: (id) oNode;
我理解SEL的意思(感谢vittal) http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/Chapters/ocSelectors.html
我通过nil
代替[[ alloc]init]