Apple actually has sample code that gives a great start to a project of this type:
Peeking NSPasteboard?
-
11-06-2023 - |
سؤال
Is there some developer tool or other open source app that allows us to peek the current contents of the (or, rather: any) NSPasteboard
instance?
Browsing through the Xcode directories (contents of the /Developer
folder before Xcode 4) doesn't turn up anything that looks useful.
We're currently developing the copy and paste feature for our app and some way to conveniently debug what's currently in the pasteboard would be invaluable and would save heaps of development time..
المحلول
نصائح أخرى
You could always iterate through the pasteboard and log what's there.
for(id object in [[UIPasteboard generalPasteboard] items]) {
NSLog(@"Object: %@", object);
}
لا تنتمي إلى StackOverflow