我有一个UIViewController
与UITextView
它的观点。当用户选择文本时,有定义系统菜单项用于UIReferenceLibraryViewController
定义单词。问题是在字典被解散后单词仍然被选中。我希望它被取消选择(就像在 iBooks 中所做的那样)。
我试图取消选择这个词使用UIMenuControllerDidHideMenuNotification
:
[[NSNotificationCenter defaultCenter] addObserverForName:UIMenuControllerDidHideMenuNotification object:nil queue:nil usingBlock:^(NSNotification *notification) {
[textView setSelectedRange:NSMakeRange(0, 0)];
}];
这会取消选择该单词,但也会冻结我UIViewController
的以下消息:
2012-12-20 19:18:45.553 Pilcrow[7018:c07] Warning: Attempt to dismiss from view controller <_UIFallbackPresentationViewController: 0x75b8300> while a presentation or dismiss is in progress!
2012-12-20 19:18:45.963 Pilcrow[7018:c07] Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x75b8300>.
有任何想法吗?