
TBXML - Error Handling
By: a guest on
Feb 22nd, 2012 | syntax:
None | size: 0.66 KB | hits: 42 | expires: Never
- (void)viewDidLoad {
TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/mcomm/produto.xml"]] retain];
TBXMLElement * rootXMLElement = tbxml.rootXMLElement;
}
TBXML *tbxml = nil;
@try {
tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/mcomm/produto.xml"]] retain];;
}
@catch (NSException *exception) {
NSLog(@"Caught %@: %@", [exception name], [exception reason]);
}
TBXMLElement * xmlElement = aParentXMLElement->firstChild;
if (aParentXMLElement != nil) {
TBXMLElement * xmlElement = aParentXMLElement->firstChild;
} else {
NSLog(@"Can't proceed: aParentXMLElement is nil");
}