pasteboard

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 ask for the available types, I get eleven different flavors of said RTF, everything from...

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 just always returns NO. Any ideas? Here is the rest of the class: @interface ClipBoard...

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 pasteboard item can have more than one representation type. That they can is clear. Update: I ...

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 fails to run when called from SSH. This is because there is no pasteboard available in the SSH...

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. ...

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 <ApplicationServices/ApplicationServices.h> int copyThatThing(void) { PasteboardRef clipboard; if (PasteboardCreate(kPasteboardClipboard, &clipboard) != noErr) { return -1; ...

data share between two iphone apps

Hello, 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. ...

How can I delay pasting promised data after it is requested ?

Hi, I am writing an application which enables the user to share the pasteboard of his local machine with that of a remote Mac to which the user connects to. The application I am writing runs on the remote Mac. It all works fine, but sometimes the pasteboard data can get large and take quite some time to travel over the network. This ...

How do I make the pasteboard be handled in a secondary runloop ?

Hi, I need to make a pasteboard owner run on a thread which is not the main thread. This is because the main thread needs to do other stuff, and rendering the pasteboard data might be time-consuming. I thought of removing the pasteboard owner from the main CFRunLoop, and adding it to the CFRunLoop of another thread, but exactly how sh...

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? ...

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, by specifying -Prefer ps you can tell pbpaste to look first for Encapsula...

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 *pb = [NSPasteboard generalPasteboard]; NSArray *types = [NSArray arrayWithObjects:NSStri...

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 think it's related to the copy command) and the app crashes. Once in a while, this has a...

iphone sdk - problem pasting into current text location

Hi guys I'm trying to paste text right into where the cursor currently is. I have been trying to do what it says at: - http://dev.ragfield.com/2009/09/insert-text-at-current-cursor-location.html The main deal is that I can't just go textbox1.text (etc) because the textfield is in the middle of a custom cell. I want to just have some te...

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 NSArrayController. The NSTableView is a drag source and I have an NSView as a drag destina...