Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将粘贴内容传递给NSString_Ios_Nsstring_Uipasteboard - Fatal编程技术网

Ios 将粘贴内容传递给NSString

Ios 将粘贴内容传递给NSString,ios,nsstring,uipasteboard,Ios,Nsstring,Uipasteboard,我要制作一个按钮,当用户单击UIButton时,将“粘贴”内容粘贴到UITextView中 我怎么能这么做? 我可以在之前将值发送到NSString吗?然后验证它是否为有效链接?非常简单: UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard]; textView.text = pasteBoard.string; 请参阅UIPasteBoard的文档。感谢您的帮助。我会读的,正是我需要的。非常感谢你。我还将阅读@maddy推荐的

我要制作一个按钮,当用户单击UIButton时,将“粘贴”内容粘贴到UITextView中

我怎么能这么做? 我可以在之前将值发送到NSString吗?然后验证它是否为有效链接?

非常简单:

UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
textView.text = pasteBoard.string;

请参阅
UIPasteBoard
的文档。感谢您的帮助。我会读的,正是我需要的。非常感谢你。我还将阅读@maddy推荐的UIPastBoard文档。