Questions tagged [pasteboard]
53 questions
42
votes
7 answers
Simple way to show the 'Copy' popup on UITableViewCells like the address book App
Is there a simple way for subclasses of UITableViewCell to show the 'Copy' UIMenuController popup like in the Address book app (see screenshot), after the selection is held for a while?
(source: icog.net)

William Denniss
- 16,089
- 7
- 81
- 124
33
votes
11 answers
Writing a string to NSPasteBoard
I cannot get this method to return YES:
- (BOOL) writeToPasteBoard:(NSString *)stringToWrite
{
return [pasteBoard setString:stringToWrite forType:NSStringPboardType];
}
I have verified that stringToWrite is coming through properly, the method…

joshwbrick
- 5,882
- 9
- 48
- 72
26
votes
6 answers
Getting RTF data out of Mac OS X pasteboard (clipboard)
According to the man page for pbpaste,
-Prefer {txt | rtf | ps}
tells pbpaste what type of data to look for in the pasteboard
first. As stated above, pbpaste normally looks first for plain
text data; however, …

Carl
- 263
- 3
- 4
17
votes
2 answers
How to get HTML data out of of the OS X pasteboard / clipboard?
I do have to send a report regarding pasting some clipboard content into a web rich editor and I need a way to dump/restore the clipboard content to (probably) HTML.
How can I do this?
It seems that pbcopy / pbpaste do alway give me text even if I…

sorin
- 161,544
- 178
- 535
- 806
14
votes
4 answers
Is the clipboard officially called "pasteboard" on iOS?
I am writing an iOS app and I just want to make sure I call it the appropriate thing. I'm used to clipboard but apparently Apple calls it a pasteboard on iOS. Googling doesn't turn anything specific up.
I see the class is called UIPasteboard but I'm…

devios1
- 36,899
- 45
- 162
- 260
11
votes
2 answers
How to copy to clipboard with X11?
Using the frameworks on OS X, I can use the following to copy a PNG to the pasteboard (in C — obviously I could use NSPasteboard with Cocoa):
#include
int copyThatThing(void)
{
PasteboardRef…

Michael
- 11,612
- 10
- 41
- 43
8
votes
5 answers
iOS - UIPasteboard not working outside app
I think this is more of an SDK flaw than my apps' but recently I've been trying to use UIPasteboard to copy strings from my app and it works fine to pasting somewhere when I'm inside the app.
When I jump to another app by either pressing the home…

Thiago Peres
- 824
- 1
- 11
- 16
7
votes
3 answers
Copy NSAttributedString to pasteboard
Brand new to Cocoa and I'm trying to figure out how to copy an NSAttributedString to the pasteboard. I've looked in the docs and not sure if I'm supposed to use a NSPasteboardItem or not.
Here's what I have to copy a regular NSString:
NSPasteboard…

Chris
- 988
- 3
- 18
- 30
6
votes
1 answer
iOS Pasteboard strange random crash
Our app received the crash multi times due to use Pasteboard. Under this situation when I try to use system Notes paste the content, the system notes will block too. So I write a program try to read the pasteboard, but it will also crash when I use…

afei
- 123
- 1
- 11
5
votes
2 answers
Unfiltering NSPasteboard
Is there a way to unfilter an NSPasteboard for what the source application specifically declared it would provide?
I'm attempting to serialize pasteboard data in my application. When another application places an RTF file on a pasteboard and then I…

MyztikJenz
- 1,650
- 14
- 19
5
votes
2 answers
data share between two iphone apps
i want to share text data between two iphone apps. How can i use paste board for this purpose. Can anyone help me with a sample code. Thanks in advance. Suggest me if there are better ways than pasteboard to accomplish my task.

ksskr
- 238
- 4
- 15
4
votes
1 answer
Pass object pointer in drag/drop operation
Is it possible to pass the pointer to an object in a drag and drop operation?
Here is the scenario...
I have an 'NSArray' of custom objects. For arguments sake we'll say this is a list of person objects.
The list is tied to an NSTableView via an…

Hooligancat
- 3,588
- 1
- 37
- 55
3
votes
1 answer
Copy to pasteboard file paths and urls on Snow Leopard or above
I want to copy file paths in clipboard so they can be copied in text editors as strings but I want them also available to Finder to copy files.
I've written the code shown below compliant with Snow Leopard guidelines (eg use writeObjects when copy…

dafi
- 3,492
- 2
- 28
- 51
3
votes
2 answers
Swift 4+: Issues copying a String to Clipboard using NSPasteboard
I had this all working in Swift 3 and earlier but with Swift 4 no matter what variation I use this code will instead output text as a URL. If I put in "This is my sample text" the output after pasting the clipboard will be…

kiddslopp
- 95
- 1
- 8
3
votes
0 answers
Getting origin and time of last Pasteboard item entry on Mac
Is there any way I can get the last time of entry made to the NSPasteboard and the application from which the copy/cut operation was performed on a Mac using Objective-C code or some terminal command

Abhinav
- 63
- 1
- 8