use*_*019 16
Apple有一个粘贴板编程指南,您正在寻找的主要类是NSPasteboard
读取字符串的示例是
NSPasteboard *pasteboard = <#Get a pasteboard#>;
NSArray *classes = [[NSArray alloc] initWithObjects:[NSString class], nil];
NSDictionary *options = [NSDictionary dictionary];
NSArray *copiedItems = [pasteboard readObjectsForClasses:classes options:options];
if (copiedItems != nil) {
// Do something with the contents...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7835 次 |
| 最近记录: |