0

여기 나는 그것이아이폰 OS 6 : 사용자 정보는

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

그리고 여기가 선택 방법 receiveClipBoardNotification에 대한 구현의 복사 선택한 텍스트를 처리 할 필요는 판지 변경 이벤트에 대한 알림 관찰자의 판지 변경 알림에 대한 무기 호를 반환합니다 :

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

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

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

문제는에서 iOS 5에 완벽하게 작동하지만 [알림 사용자 정보] 반환, 아이폰 OS 6에 nil을 것입니다.

답변

0

음,이

NSLog(@"%@", [[UIPasteboard generalPasteboard] string]); 
를 아이폰 OS 6 일