17.05.2014 Views

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

@try {<br />

...some <strong>TET</strong> instructions...<br />

}<br />

@catch (<strong>TET</strong>Exception *ex) {<br />

NSString * errorMessage =<br />

[NSString stringWithFormat:@"<strong>TET</strong> error %d in '%@': %@",<br />

[ex get_errnum], [ex get_apiname], [ex get_errmsg]];<br />

NSAlert *alert = [[NSAlert alloc] init];<br />

[alert setMessage<strong>Text</strong>: errorMessage];<br />

[alert runModal];<br />

[alert release];<br />

}<br />

@catch (NSException *ex) {<br />

NSAlert *alert = [[NSAlert alloc] init];<br />

[alert setMessage<strong>Text</strong>: [ex reason]];<br />

[alert runModal];<br />

[alert release];<br />

}<br />

@finally {<br />

[tet release];<br />

}<br />

In addition to the get_errmsg method you can also use the reason field of the exception<br />

object to retrieve the error message.<br />

3.7 Objective-C Binding 33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!