iPad中的NSDocument目录路径问题?

时间:2013-02-16 07:59:07

标签: ios ipad cocoa-touch nsdocumentdirectory

我在iPad应用程序中工作,使用Xcode 4.3.2开发我的应用程序,我从Web服务获取pdf文件(URL),并在NSDocumentDirectory路径中下载pdf文件,然后从NSDocument目录路径中检索pdf文件显示在

  NSString *pathlink = (NSDocument Directory Path)
  NSURL *pdfUrl = [NSURL fileURLWithPath:pathlink];
  pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfUrl);
  CFRelease(pdfUrl);

Below this classes for Curl page animation:
LeavesCache.h
LeavesView.h
LeavesViewController.h
Utilities.h

然后每个页面都转动卷曲动画并在我的ipad模拟器中运行并且工作正常。 然后我试图在我的iPod设备中运行此应用程序设备版本是ios6.1所以,我插入ipa文件在iTunes中连接运行此。当我点击打开pdf文件应用程序崩溃时,我尝试了我的最佳水平,但我不知道,请帮助我。

感谢Advnce

错误:

Ipad ReportCrash[7011] <Notice>: Formulating crash report for process PublishGenieApplication[7008]
Ipad com.apple.launchd[1] (UIKitApplication:com.everestindia.apps[0x7e28][7008]) <Warning>: (UIKitApplication:com.everestindia.apps[0x7e28]) Job appears to have crashed: Segmentation fault: 11
Ipad backboardd[26] <Warning>: Application 'UIKitApplication:com.everestindia.apps[0x7e28]' exited abnormally with signal 11: Segmentation fault: 11
Ipad ReportCrash[7011] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
 Ipad ReportCrash[7011] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/genieapplication_2013-02-16-131259_Ipad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

1 个答案:

答案 0 :(得分:0)

我必须解决这个问题,试试这个

CFURLRef pdfURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:myFilePath];
pdf = CGPDFDocumentCreateWithURL(pdfURL);
CFRelease(pdfURL);

我希望能帮助任何人