我有同樣的問題。只需使用我們的一臺測試設備即可輕鬆讀取iCloud文檔。重新安裝該應用程序不會影響該錯誤。
我正在使用NSMetadataQuery來獲取文件URL。我對NSMetadataQueryDidFinishGatheringNotification接收器看起來像這樣:
- (void)queryDidFinishGathering:(NSNotification *)notification
{
NSMetadataQuery *query = [notification object];
[query disableUpdates];
[query stopQuery]; // <--- This was the problem
NSMetadataItem *item = [query resultAtIndex:0];
NSURL *url = [item valueForAttribute:NSMetadataItemURLKey];
UIDocument *doc = [[CustomDocument alloc] initWithFileURL:url];
[doc openWithCompletionHandler:^(BOOL success) {
// EXC_BAD_ACCESS before completion block is called :'(
}];
[query enableUpdates];
}
卸下stopQuery
呼叫固定的一切!
控制檯中的錯誤是什麼,你能證實你成功地打開了你的'UIDocument'嗎? (很多操作都是異步的) – aforaudrey 2012-08-06 06:51:07
@iBlue在控制檯中根本沒有輸出。 UIDoc未成功打開,即我在openWithCompletionHandler的成功塊中所做的事情:^(BOOL成功)未執行。它之前崩潰了。所以我想我提供的崩潰截圖並沒有真正說明錯誤來源,是嗎? – 2012-08-06 07:34:27
@ n.evermind,我也有類似的問題......你能告訴我們你是如何修復它的嗎?這對我很有幫助。 – Ananth 2013-01-22 14:04:45