0

場所にあるpdfファイルを開くコードを記述します

  NSArray  *paths =    NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
        NSString *documentsDir = [paths objectAtIndex:0];
        NSString *pdfFilePath =[documentsDir  stringByAppendingPathComponent:@"421_core_animation_essentials.pdf"];
        fileURL = [NSURL URLWithString:pdfFilePath];
        QLPreviewController *previewController = [[QLPreviewController alloc] init];
        previewController.dataSource = self;
        [[self navigationController] pushViewController:previewController animated:YES];
        [previewController.navigationItem setRightBarButtonItem:nil];
        [previewController release];

シミュレーターでのテスト中は機能していますが、iPad デバイスでのテスト中は機能しません。私を助けてください。

4

1 に答える 1

0

iOS デバイスのファイル システムは、そうでないシミュレータとは異なり、大文字と小文字を区別します。

したがって、ファイル名の大文字と小文字の区別を確認してください。

NSString *pdfFilePath =[documentsDir  stringByAppendingPathComponent:@"421_core_animation_essentials.pdf"];
于 2012-08-09T11:38:44.070 に答える