Search Results

Search found 8 results on 1 pages for 'uipasteboard'.

Page 1/1 | 1 

  • copy HTML to UIPasteboard

    - by ManniAT
    Hi, I want to transfer HTML from my app to the iPhone mail application. I already have the HTML text - lest say <span style='color:red'Test</span I can place this to UIPasteBoard - but when I paste it to mail I get the html source. When I place the same string in a HTMLView - select it there and copy it it pastes as red text in mail. What do I have to do to place the string in the UIPasteBoard so that it pastes as red text to the mail application? I've been searching for "format types" - and found that UIPasteBoard returns "Aplle Web Archive pasteboard type" when I have the element (copied from UIWebView) in the clipboard. But setting this as type when adding the content to UIPasteBoard pastes nothing in the mail app. Manfred

    Read the article

  • Getting NSRange from Subclassed UIPasteboard Selection

    - by PF1
    Hi Everyone: I am wondering if there is some way to subclass UIPasteboard in order to get the selection behavior, but not get the "Cut, Copy, and Paste" options. In addition to this, is there some notification I can subscribe to that returns the NSRange of the selected body of text once it is selected? Thanks for any help!

    Read the article

  • iPhone generalPasteboard loses contents if application is closed by an -openURL: call

    - by Kojiro
    I have a method, that puts something on the pasteboard. This method is called one of two ways, one, as an IBAction from a button, the other from another method which afterwards closes the application by doing: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]]; The problem arises only when the application is not closed using the home button, but is closed using the line above. When that happens, the pasteboard contents are lost. I assume this problem has something to do with the object being cleaned up improperly when it closes this way, but have no idea why it is doing that. I have even tried to intentionally leak the object that gets put on the pasteboard, but it still gets lost on the way out. Here is the method: - (IBAction) copyLink { NSString *stringForPasteboard = @"here is the string"; [[UIPasteboard generalPasteboard] setURL:stringForPasteboard]; [stringForPasteboard release]; }

    Read the article

  • UITextView cut problem !

    - by Mc.Lover
    Hi , i have problem with cut some text from UITextView , i idon't understand how can implement Cut , for example copy or paste it's like this : -(IBAction)copy { NSString *copyString = [[NSString alloc] initWithFormat:@"%@",[textPad text]]; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyString]; } -(IBAction)paste { UIPasteboard *pb = [UIPasteboard generalPasteboard]; textPad.text = [pb string]; } but about cut ! thank you ,

    Read the article

  • UITextView cut problem ! (iPhone sdk)

    - by Mc.Lover
    Hi , i have problem with cut some text from UITextView , i idon't understand how can implement Cut , for example copy or paste it's like this : -(IBAction)copy { NSString *copyString = [[NSString alloc] initWithFormat:@"%@",[textPad text]]; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyString]; } -(IBAction)paste { UIPasteboard *pb = [UIPasteboard generalPasteboard]; textPad.text = [pb string]; } but about cut ! thank you ,

    Read the article

  • Graceful degradation on iPhone

    - by Seva Alekseyev
    How do I write a program for iPhone (Objective C++) that runs on OS 2.0 but takes advantage of 3.0 features if they're available? Example: copy&paste (class UIPasteboard). Nice feature to have, but I don't want to kill backward compatibility. Do I compile against SDK v. 3 or v. 2? If the latter, how do I create an instance of UIPasteboard, considering it's not declared in the headers? If the former, won't some C-linkage functions cause "unresolved reference" upon loading under OS 2.0?

    Read the article

  • iphone sdk - problem pasting into current text location

    - by norskben
    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 text added to where the cursor is (when I press a custom key on a keyboard). -I just want to paste a decimal into the textbox... The error I get is: 2010-05-15 22:37:20.797 PageControl[37962:207] * -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10 2010-05-15 22:37:20.797 PageControl[37962:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10' Note: I have access to the textfield tag (if that helps?) I'm a little past the beginner stage in objective-c, but still not great. My code is currently below, and at https://gist.github.com/d634329e5ddf52945989 Thanks all. MyDetailController.h @interface MyDetailController : UITableViewController <UITextFieldDelegate,UINavigationControllerDelegate> { //...(lots in here) } @end @interface UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text; @end MyDetailController.m @implementation MyDetailController //.... (lots in here) - (void)addDecimal:(NSNotification *)notification { // Apend the Decimal to the TextField. //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; NSLog(@"Decimal Pressed"); NSLog(@"tagClicked: %d",tagClicked); switch (tagClicked) { case 7: //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; break; case 8: //goalAmount.text = [goalAmount.text stringByAppendingString:@"."]; break; case 9: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; case 10: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; } [self insertText:@"."]; } -(void)textFieldDidBeginEditing:(UITextField *)textfield{ //UITextField *theCell = (UITextField *)sender; tagClicked = textfield.tag; NSLog(@"textfield changed. tagClicked: %d",tagClicked); } @end @implementation UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text { // Get a refererence to the system pasteboard because that's // the only one @selector(paste:) will use. UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard]; // Save a copy of the system pasteboard's items // so we can restore them later. NSArray* items = [generalPasteboard.items copy]; // Set the contents of the system pasteboard // to the text we wish to insert. generalPasteboard.string = text; // Tell this responder to paste the contents of the // system pasteboard at the current cursor location. [self paste: self]; // Restore the system pasteboard to its original items. generalPasteboard.items = items; // Free the items array we copied earlier. [items release]; } @end

    Read the article

1