2010-12-02 19 views
0

J'ai un problème dans Lib xml parser.Lib xml délégué sélecteur ne fonctionne pas

Dans le document final du code ci-dessous est ici

-(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]; 
      } 
    } 

Je commentais à la condition d'échec dans le code ci-dessus.

Merci, Madan mohan.

Répondre

2

Je pense qu'il ya une vérification des fautes d'orthographe sur cette ligne

SEL sélecteur = @selector (parse: encounteredError: FORID: forObj :);

analyseur utiliser au lieu de parse

!!! Cheers !!!