Pasteboards and Nil-Targeted Actions(Chapter 21 of Cocoa Programming for Mac OS
1 - (void)writeToPasteboard:(NSPasteboard *)pb2 {
3 owner:self];
4 ;
5 }
6
7 - (BOOL)readFromPasteboard:(NSPasteboard *)pb
8 {
9 NSArray *types = ;
10 if()
11 {
12 NSString *value = ;
13 if( == 1)
14 {
15 ;
16 return YES;
17 }
18 }
19
20 return NO;
21 }
22
23 - (IBAction)cut:(id)sender
24 {
25 ;
26 ;
27 }
28
29 - (IBAction)copy:(id)sender
30 {
31 NSPasteboard *pb = ;
32 ;
33 }
34
35 - (IBAction)paste:(id)sender
36 {
37 NSPasteboard *pb = ;
38 if (!)
39 {
40 NSBeep();
41 }
42 }
页:
[1]