2

I have a strange problem, I believe I might just need some entitlement to declare to make it work.

I have some text view that user could copy text, and it could be pasted into another text fields inside the app. But when the user exit (or suspend ) the app, the user has no content in the clipboard and could not paste the text into another app. ( Such as, the user copied an URL from my app, but when he try to paste it inside Safari, nothing could be paste , the clipboard is empty).

[UPDATED] I found the problem and some discussion here: https://stackoverflow.com/a/8442428/140860

Community
  • 1
  • 1
snakewa
  • 118
  • 3
  • 10
  • I'm having the same problem... http://stackoverflow.com/questions/8402374/ios-uipasteboard-not-working-outside-app – Thiago Peres Dec 08 '11 at 21:12
  • I found that when I remove Flurry Analytics , everything is fine. I guess the lib does something on "EnterBackground" event. – snakewa Dec 09 '11 at 07:36

1 Answers1

0

During app resignation make copy board as empty

try this...

In your app delegate:

-(void)applicationWillResignActive:(UIApplication *)application
{
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = @"”;
}

-(void)applicationDidEnterBackground:(UIApplication *)application
{
   UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = @"”;
}

-(void)applicationWillTerminate:(UIApplication *)application
{
   UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = @"”;
} 

then when you try to paste across apps It will be empty... So, Easy