Created
August 10, 2019 23:49
-
-
Save raphlinus/52dd3be6f4ac9590318286aa3e427c0a to your computer and use it in GitHub Desktop.
simple toy for inspecting pasteboard types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// Pasteboard toy | |
// | |
// Created by Raph Levien on 8/10/19. | |
// Copyright © 2019 Raph Levien. All rights reserved. | |
// | |
#import "AppDelegate.h" | |
@interface AppDelegate () | |
@end | |
@implementation AppDelegate | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { | |
// Insert code here to initialize your application | |
NSArray *items = [[NSPasteboard generalPasteboard] pasteboardItems]; | |
NSLog(@"Number of pasteboard items: %lu", [items count]); | |
for (int i = 0; i < [items count]; i++) { | |
NSPasteboardItem *item = items[i]; | |
NSArray<NSPasteboardType> *types = [item types]; | |
NSLog(@"Item %i, number of types: %lu", i, [types count]); | |
for (int j = 0; j < [types count]; j++) { | |
NSLog(@"%@", types[j]); | |
} | |
} | |
} | |
- (void)applicationWillTerminate:(NSNotification *)aNotification { | |
// Insert code here to tear down your application | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment