0
phonegap 응용 프로그램에서 UIDocumentInteractionController를 사용하여 장치에서 파일을로드하려고합니다. 나는 따라 다녔다.UIDocumentInteraction의 <QLRemotePreviewContentController : 0x7d19a000>에 대한 모양 전환의 시작/종료 균형이 불균형
이CDVViewController* mainController = (CDVViewController*)[ super viewController ];
UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:fileLocation]];
FileViewer *vController = [[FileViewer alloc]init];
[mainController addChildViewController:vController];
documentInteractionController.delegate = vController;
[documentInteractionController presentPreviewAnimated:YES];
오류 메시지 제공함으로써이 결과 : "분리 된 뷰 컨트롤러에 뷰 컨트롤러를 제시는 권장하지 않습니다
#import <Foundation/Foundation.h>
#import <QuickLook/QuickLook.h>
@interface FileViewer : UIViewController <UIDocumentInteractionControllerDelegate>
@end
@implementation FileViewer
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (UIViewController *) documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller {
return self;
}
- (void)viewDidLoad
{
[self viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end은
Launcher.mi에서이 파일을 표시하려면 다음을 수행했다 QLRemotePreviewContentController에 대한 시작/종료 모양 전환의 불균형 호출 "
미리 감사드립니다 !!