NSTemporaryDirectory 폴더에 "temp.pdf"라는 파일의 파일 경로를 가져 오려고합니다 (파일을 확인했습니다).임시 디렉토리에있는 파일의 파일 경로 및 URL 얻기
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp.pdf" ofType:@"" inDirectory:NSTemporaryDirectory()];
: 그리고 내가 함께 해봤
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf" inDirectory:NSTemporaryDirectory()];
:
나는이 사용
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf"];
그러나 작동하지 않는 것 같다, 반환 값은 항상 null입니다.
그래서 약간 혼란스럽고 누군가 나를 도울 수 있습니까?
감사합니다.
좋아, 그렇게 할 때 [UIDocumentInteractionController interactControllerWithURL : filepath]와 함께 파일 경로를 사용하고 싶습니다. [NSURL urlWithString : filepath]를 만들었지 만 Xcode에서는 "잘못된 스키마 (null)입니다. 파일 스키마 만 지원됩니다." – HasgardLucian
'NSURL * furl = [NSURL fileURLWithPath : NSTemporaryDirectory() stringByAppendingPathComponent : @ "temp.pdf"]] ' – Joe
임시 디렉토리에 모든 pdf 파일을 반환하려면 어떻게해야합니까 ?? –