Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
simple toy for inspecting pasteboard types
// AppDelegate.m
// Pasteboard toy
// Created by Raph Levien on 8/10/19.
// Copyright © 2019 Raph Levien. All rights reserved.
#import "AppDelegate.h"
@interface AppDelegate ()
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.