Questions tagged [pasteboard]
53 questions
3
votes
3 answers
Would the general iPhone pasteboard ever contain more than one item?
Would pasteboard.numberOfItems (in the code below) ever be greater than 1? How would the user cause this to happen?
UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
pasteBoard.numberOfItems
Note that I'm not asking if a single…

Daryl Spitzer
- 143,156
- 76
- 154
- 173
3
votes
2 answers
Input a string to application without pasteboard or simulating typing
I need to paste a string of text to whichever application is open, and I'd rather not clear the pasteboard, in case something important is there, and I'd rather not turn every single character into a keyboard event.
Is there another way?

tsdexter
- 2,911
- 4
- 36
- 59
2
votes
1 answer
Sending text results to the clipboard in Xcode
This is within the latest Xcode.
I have 4 arrays that produce a result to the screen with an OK button. I would like to add a function that copies the result to the clipboard. Does that make sense?
While I am not exactly sure how this is done, I am…

Phineas T Parks
- 23
- 5
2
votes
1 answer
iOS copy multiple images to pasteboard
I can copy one image to the pasteboard like so:
UIPasteboard *pasteboard;
pasteboard = [UIPasteboard generalPasteboard];
UIImage *image;
[pasteboard setImage:image];
How can I copy two or three images to the pasteboard?

Albert Renshaw
- 17,282
- 18
- 107
- 195
2
votes
1 answer
Drag String data from My Cocoa App to Third-Party Cocoa App
I want to drag a row from my tableview and drop it into any other NSTextField in Mac OS X 10.6, and have a string of text be dropped.
Drag and drop already works within my app (between a NSTableView and an NSBrowser), but I have had no success…

Woodster
- 3,451
- 3
- 17
- 19
2
votes
1 answer
Accessing OS X kill ring programmatically
I recently noticed, that OS X has another clipboard which you can access by killing something with ctrl + K and then yanking it with ctrl + Y.
I know I can access OS Xs normal clipboard with pbcopy and pbpaste. Sadly you cannot access the kill ring…

hgiesel
- 5,430
- 2
- 29
- 56
2
votes
1 answer
Crashing the OS X Pasteboard
I have an application that reads in text by emulating CMD-C copy commands and reading the pasteboard - unfortunately this the only way to achieve what I need. Occasionally, as this is under development, once in a while I do something wrong (I don't…

Ben Packard
- 26,102
- 25
- 102
- 183
2
votes
1 answer
How can I read data from the general pasteboard for all classes?
At the moment I'm using readObjectsForClasses: to retrieve a list of objects from the general pasteboard in cocoa, which works whenever I want to only retrieve objects of a certain class e.g. NSString or NSImage etc.
However, I would like to be able…

Luke
- 4,908
- 1
- 37
- 59
2
votes
4 answers
Android - Copy image to clipboard, anyone got this working?
I am trying to copy a image file from my apk to the clipboard.
Here is how I am approaching it (roughly, i'm using a content provider locally which is out of the scope of the question.
ClipboardManager mClipboard = (ClipboardManager)…

PersuitOfPerfection
- 1,009
- 1
- 15
- 28
2
votes
2 answers
Does iPhone have a clipboard API?
Does iPhone have a clipboard API? It seems one can call an API function to set text to the pasteboard which will be accessible by other apps., but can someone verify that this is correct?
Thanks.

bhartsb
- 21
- 1
- 2
2
votes
4 answers
Is it possible to access the Mac OS X pasteboard when logged in via SSH?
We have the following snippet.
OSStatus createErr = PasteboardCreate(kPasteboardClipboard, &m_pboard);
if (createErr != noErr) {
LOG((CLOG_DEBUG "failed to create clipboard reference: error %i" createErr));
}
This compiles fine, however, it…

Nick Bolton
- 38,276
- 70
- 174
- 242
2
votes
0 answers
Using UIPasteboard to share data with iOS Numbers App
I'm wanting to share data in my app with iOS Numbers via the Pasteboard. I've written the following code: -
NSData *data1 = [@"Col1,1\tCol1,2\n\nCol2,1\tCol2,2\n" dataUsingEncoding:NSASCIIStringEncoding];
[[UIPasteboard generalPasteboard]…

Martyn
- 41
- 3
1
vote
1 answer
How to use NSPasteboard to transfer data between applications (using contextual menus)
"NSPasteboard objects transfer data to and from the pasteboard server. The server is shared by all running applications. It contains data that the user has cut or copied, as well as other data that one application wants to transfer to another.…

hollow7
- 1,506
- 1
- 12
- 20
1
vote
0 answers
Ios use Pasteboard get error "Operation not authorized"
When i use UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; get some data from Pasteboard, then got this error, How to resolve this. Im using Xcode13.4 and ios15.4 phone.
2023-03-15 17:43:46.557427+0800[89748:38866953]…

Carey
- 307
- 2
- 5
- 13
1
vote
1 answer
Pasteboardmanager reference
HI i have an old code which uses a scrapref and selects scrap using GetScrapbyname(kscrapclipboardscrap,kscrapgetnamedscrap,&scrapref);
Than it takes the flavour count using getscrapflavourcount and then the list using getscrapinfoflavourlist
As the…

Peter
- 2,719
- 4
- 25
- 55