Advertisement
Guest User

TBXML - Error Handling

a guest
Feb 22nd, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. - (void)viewDidLoad {
  2.  
  3. TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/mcomm/produto.xml"]] retain];
  4. TBXMLElement * rootXMLElement = tbxml.rootXMLElement;
  5.  
  6.  
  7.  
  8. }
  9.  
  10. TBXML *tbxml = nil;
  11. @try {
  12. tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/mcomm/produto.xml"]] retain];;
  13. }
  14. @catch (NSException *exception) {
  15. NSLog(@"Caught %@: %@", [exception name], [exception reason]);
  16. }
  17.  
  18. TBXMLElement * xmlElement = aParentXMLElement->firstChild;
  19.  
  20. if (aParentXMLElement != nil) {
  21. TBXMLElement * xmlElement = aParentXMLElement->firstChild;
  22. } else {
  23. NSLog(@"Can't proceed: aParentXMLElement is nil");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement