Guest User

Untitled

a guest
Jul 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. CXMLDocument *document = [[[CXMLDocument alloc] initWithXMLString:responseString options:0 error:nil] autorelease];
  2. NSArray *nodes = [document nodesForXPath:@"//data" error:nil];
  3. for (CXMLElement *xmlElement in nodes) {
  4. NSLog(@"XML: %@", xmlElement);
  5. NSString *value = [[[xmlElement elementsForName:@"status"] objectAtIndex:0] stringValue];
  6. if (value == @"error")
  7. {
  8. UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error"
  9. message:@"Los datos ingresados no coinciden"
  10. delegate:nil
  11. cancelButtonTitle:@"OK"
  12. otherButtonTitles:nil];
  13. [errorAlert show];
  14. [errorAlert release];
  15. }
  16. else {
  17. NSLog(@"Status: %s", value);
  18. }
  19.  
  20. }
Add Comment
Please, Sign In to add comment