IOS读写剪切板 UIPasteboard (备忘)

写剪切板 spa

UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:@"a.com" create:YES]; it

 [slotPB setData:[NSKeyedArchiver archivedDataWithRootObject:@"hello"] forPasteboardType:@"test"]; ast

读剪切版 test

UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:@"a.com"  create:YES]; co

NSString *txt = [NSKeyedUnarchiver unarchiveObjectWithData:[slotPB dataForPasteboardType:@"test"]]; data

 NSLog(@"%@", txt); arc

相关文章
相关标签/搜索