2010-11-25 32 views
2

我正在使用UIDocumentInterationController在我的iPad應用程序中顯示文檔。 我想,當文檔被closed.I使用下面的委託方法來執行的東西: -從UIDocumentInterationController結束文檔的委託方法

- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller{ 
    NSLog(@"End Document"); 
} 

,但它不work.Please讓我知道它的委託方法,當我們按下完成按鈕的隱藏的被稱爲documentController?

在此先感謝

+0

你解決了這個問題嗎? – 2011-04-22 09:03:24

+0

我還沒有找到任何解決此問題的方法 – Deepika 2011-04-25 08:09:41

回答

2

我通過添加presentPreviewAnimated呼叫後保留通話得到了這個工作。 然後在DidEndPreview方法中,我將它設置爲autorelease。 讓我知道這是否有幫助,或者您需要更多信息,如代碼示例。

3

在ARC中使用Xcode 4時,不能調用retain。爲了使它與ARC一起工作,只需在頭文件中聲明你的docController爲一個ivar,然後通常在你的代碼中創建你的docController。

docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];