Iphone 库xml委托选择器不工作
我在Lib-xml解析器中遇到了一个问题 在文档末尾,下面的代码在这里Iphone 库xml委托选择器不工作,iphone,objective-c,libxml2,Iphone,Objective C,Libxml2,我在Lib-xml解析器中遇到了一个问题 在文档末尾,下面的代码在这里 -(void)endDocument { NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"Failed with 404 or 500" forKey:@"error_message"];
-(void)endDocument
{
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"Failed with 404 or 500"
forKey:@"error_message"];
NSError *error = [NSError errorWithDomain:@"ParsingDomain"
code:500
userInfo:userInfo];
SEL selector = @selector(parse:encounteredError: forId: forObj:);
NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector];
if(nil != sig && [self.delegate respondsToSelector:selector]) // this codition is failed
{
printf("\n In the selector invocation");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig];
[invocation retainArguments];
[invocation setTarget:self.delegate];
[invocation setSelector:selector];
[invocation setArgument:&self atIndex:2];
[invocation setArgument:&error atIndex:3];
[invocation setArgument:&Id atIndex:4];
[invocation setArgument:&obj atIndex:5];
[invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO];
}
}
我在上面代码中对失败的条件进行了注释
谢谢,,
Madan mohan。我想这行有拼写错误检查 SEL选择器=@selector(解析:遇到错误:forId:forObj:) 使用解析器而不是解析 !!!干杯