UIPasteboard 类的使用

翻看文档在下面目录

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,OS,application,search,System,fonts)