UIScrollView で PDF を表示します。そうするために私は使用します:
myDocumentRef = CGPDFDocumentCreateWithURL((CFURLRef)[[NSBundle mainBundle] URLForResource:@"salonMap" withExtension:@"pdf"]);
今、私はそれを IOS 3.1 で動作させようとしています (NSBundle URLForResource:withExtension は 3.1 には存在しません)。
私は自分のコードを次のように変えました:
NSString *fullPath = [[NSBundle mainBundle] pathForResource:@"salonMap" ofType:@"pdf"];
NSLog(@"%@", fullPath);
CFStringRef fullPathEscaped = CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)fullPath, NULL, NULL,kCFStringEncodingUTF8);
CFURLRef urlRef = CFURLCreateWithString(NULL, fullPathEscaped, NULL);
myDocumentRef = CGPDFDocumentCreateWithURL(urlRef);
しかし、それは
<Error>: CFURLCreateDataAndPropertiesFromResource: failed with error code -15
NSLogがログを記録していることを正確に
/var/mobile/Applications/1CF69390-85C7-45DA-8981-A279464E3249/myapp.app/salonMap.pdf"
これを修正するにはどうすればよいですか?