翻看文档在下面目录
iOS 5.1 Library>General>Cocoa Application Competencies for iOS>Pasteboard
发现一段
Pasteboards can be public or private to one or more applications. Public pasteboards are system provided and are available to all applications. All pasteboards, public and private, must have a unique name. Both platforms have general-purpose pasteboards and pasteboards used in search operations. In iOS, these pasteboards are namedUIPasteboardNameGeneral and UIPasteboardNameFind; in Mac OS X, they are named NSGeneralPboard andNSFindPboard. Mac OS X has additional named system pasteboards for rulers, fonts, and drag-and-drop operations. An application on either platform typically uses one of the system pasteboards, but may create a private pasteboard under a unique name; for example, it might create a private pasteboard to share data with a “sibling” application that was created by the same software vendor.
可以实现夸app的和拷贝和粘贴数据.
代码1
[UIPasteboard removePasteboardWithName:@"Demo"];
UIPasteboard *pasteb = [UIPasteboard pasteboardWithName:@"Demo" create:YES];
pasteb.strings = [NSArray arrayWithObjects:@"watsy0007",@"123456", nil];
代码2
UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:@"Demo" create:NO];
NSLog(@"pasteboardTypes : %@",[pasteboard strings]);
[pasteboard release];
本文探讨了iOS环境下应用间如何通过公共和私有剪贴板实现数据共享,介绍了剪贴板的类型及其在不同平台上的命名,并提供了创建和使用私有剪贴板的代码示例。
3万+

被折叠的 条评论
为什么被折叠?



