【发布时间】:2012-04-05 11:08:45
【问题描述】:
我正在尝试将 NSString(文档目录中文件的路径)转换为 NSURL,但 NSURL 始终为空。这是我的代码:
NSURL *urlToPDF = [NSURL URLWithString:appDelegate.pdfString];
NSLog(@"AD: %@", appDelegate.pdfString);
NSLog(@"PDF: %@", urlToPDF);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)urlToPDF);
这是日志:
2012-03-20 18:31:49.074 The Record[1496:15503] AD: /Users/John/Library/Application Support/iPhone Simulator/5.1/Applications/E1F20602-0658-464D-8DDC-52A842CD8146/Documents/issues/3.1.12/March 1, 2012.pdf
2012-03-20 18:31:49.074 The Record[1496:15503] PDF: (null)
我认为部分问题可能是 NSString 包含斜杠 / 和破折号 -。我做错了什么?谢谢。
【问题讨论】:
标签: iphone objective-c ios ipad nsurl