Hello guys,
this is my function. it works normally very well, it return the description of webpages. but in case that the web page does not have description i want to avoid error in my program.
here is my function, it works well in this case.
but when i put it in try/catch like this the function does not operate at all! any reason?
this is my function. it works normally very well, it return the description of webpages. but in case that the web page does not have description i want to avoid error in my program.
here is my function, it works well in this case.
Code:
-(NSString *)description{
NSArray *elements=[html searchWithXPathQuery:@"/html/head/meta[@name=\"description\"]/@content"];
TFHppleElement *e= [elements objectAtIndex:0];
return [e content];
}
but when i put it in try/catch like this the function does not operate at all! any reason?
Code:
-(NSString *)description{
@try {
NSArray *elements=[html searchWithXPathQuery:@"/html/head/meta[@name=\"description\"]/@content"];
TFHppleElement *e= [elements objectAtIndex:0];
return [e content];
}
@catch (NSException * ee) {
}
@finally {
return @"";
}
}