Muestro un PDF en UIScrollView. Para ello utilizo:Cómo convertir la ruta de NSString a CFURLRef (para iOS 3.1)?
myDocumentRef = CGPDFDocumentCreateWithURL((CFURLRef)[[NSBundle mainBundle] URLForResource:@"salonMap" withExtension:@"pdf"]);
Ahora, trato de hacer que funcione en un IOS 3.1 (NSBundle URLForResource: withExtension no existe para 3.1)
Volví código en:
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);
pero conduce a un
<Error>: CFURLCreateDataAndPropertiesFromResource: failed with error code -15
que precisa que NSLog registra
/var/mobile/Applications/1CF69390-85C7-45DA-8981-A279464E3249/myapp.app/salonMap.pdf"
¿Cómo puedo solucionar esto?