使用 UIPasteboard 在 iOS 中复制功能
NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]];
UIPasteboard *pb = [UIPasteboard generalPasteboard];
[pb setString:copyStringverse];
我正在使用上面的代码复制 textview
中的内容,但我想复制表格单元格中的内容。如何做到这一点?
NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]];
UIPasteboard *pb = [UIPasteboard generalPasteboard];
[pb setString:copyStringverse];
I'm using above code for copying contents in textview
, but I want to copy contents in a cell of the table. How to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
好吧,您没有确切说明如何设置表视图单元格,但如果它只是表视图内的文本,则可能很简单:
Well you don't say exactly how you have your table view cell set up, but if it's just text inside your table view it could be as easy as:
对于斯威夫特 3.x
For Swift 3.x
对于 Swift 2.1+:
For Swift 2.1+:
对于 Swift2.2
通过使用它,您可以直接将值设置为
UIPasteboard
。For Swift2.2
By using this you can directly set the value to
UIPasteboard
.