0

Here's the Notification Observer for the Pasteboard change event, I need it to handle the copied selected text

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(receiveClipBoardNotification:)
                                             name:@"UIPasteboardChangedNotification"
                                           object:nil];

And here's the implementation for the selector method receiveClipBoardNotification:

- (void) receiveClipBoardNotification:(NSNotification *) notification {

//    NSMutableArray *typesAddedKey = [[notification userInfo] objectForKey:@"UIPasteboardChangedTypesAddedKey"];
//    pasteBoardItemType = [typesAddedKey objectAtIndex:0];        

    NSLog(@"%@", [notification userInfo]);
}

The problem is that [notification userInfo] returns nil on iOS 6, although it works perfectly on iOS 5.

Mohamed Salem
  • 161
  • 3
  • 9

1 Answers1

0

Well, This worked on iOS 6

NSLog(@"%@", [[UIPasteboard generalPasteboard] string]);
Mohamed Salem
  • 161
  • 3
  • 9