【发布时间】:2012-07-02 11:55:09
【问题描述】:
问题是“成功”总是返回错误?我不知道是什么问题?
我的代码如下:
UIDocumentInteractionController *docController = [[UIDocumentInteractionController interactionControllerWithURL:currentPDFPath] retain];
if (docController)
{
docController.delegate = self;
BOOL success = [docController presentOptionsMenuFromBarButtonItem:openInButton animated:YES];
//BOOL success = [docController presentOpenInMenuFromBarButtonItem:openInButton animated:YES];
NSLog(@"success: %d", success);
if(!success)
{
UIAlertView * noApps = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Your iPad doesn't seem to have any other Apps installed that can open this document (such as iBooks)" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[noApps show];
[noApps release];
}
}
[docController release];
【问题讨论】:
-
currentPDFPath 包含什么?
-
file://localhost/var/mobile/Applications/14DD059B-9969-4960-8E24-DC586A4302D1/Library/Caches/http-_wgsn.howoco.com_media_event_117_AW12_13_Tradeshow_seasonal_analysis-_colour_1340296472 .pdf%3F1340297029
-
@PriyankaChhetri 你找到解决方案了吗,请告诉我,谢谢:)
标签: objective-c ios ipad ibooks uidocumentinteraction