存在一个问题,当从Web视图复制内容时,通知“ UIPasteboardChangedNotification”将被调用两次。有谁知道为什么以及如何解决它?
答案 0 :(得分:0)
从网络视图复制内容时,此通知确实可能触发2次。您可以检查是否由于添加了某个项目而触发了通知:
- (void) pasteboardChangedNotification:(NSNotification *)notification {
if(notification.userInfo != NULL && [notification.userInfo objectForKey:UIPasteboardChangedTypesAddedKey] != NULL) {
//item added
}
else {
//nothing added
}
}