2016-07-27 4 views
0

私は研究キットの例のソースコードに探していたがORKTestと呼ばれる:Research KitでcontentURLを使用してオンラインPDFファイルをプルフォームする方法は?

if (type.integerValue == ORKConsentSectionTypeDataGathering) { 
     /* 
     Tests PDF content instead of text, HTML for Learn More. 
     */ 
     NSString *path = [[NSBundle mainBundle] pathForResource:@"SAMPLE_PDF_TEST" ofType:@"pdf"]; 
     consentSection.contentURL = [NSURL URLWithString:path]; 

    } 

それは.contentURLでローカルPDFファイルのパスを使用し、私はオンラインPDFのURLなどと交換したいのですがhttp://examle.com/file/example.pdf

consentSection.contentURL = NSURL.fileURLWithPath("http://example.com/file/example.pdf") 

または

consentSection.contentURL = NSURL.fileURLWithPath("example.com/file/example.pdf") 

だけでは、空のページ(私はブラウザに取り組んで罰金を使用したURL、ちょうどpdfファイルを持って)。

誰でも意見がありますか?

答えて

0

NSURL.fileURLWithPathはローカルファイルでのみ動作します。アプリのサンドボックスに入れてから、consentSectionにロードしてください。

+0

リサーチキットを使用してウェブのpdfファイルを直接表示する方法はありますか? – Dante

関連する問題