2010-12-02 34 views
0

我在Lib xml解析器中遇到了一個問題。Lib xml委託選擇器不起作用

在端文檔下面的代碼是在這裏

-(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。

回答

2

我覺得這是在這一行

SEL選擇= @selector(解析拼寫錯誤檢查:encounteredError:FORID:forObj :);

使用的解析器,而不是解析

!CHEERS!