使用UIPasteboard在iOS中复制function
NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]]; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyStringverse];  我正在使用上面的代码复制textview内容,但我想复制表格的单元格中的内容。 这个怎么做。 提前致谢。 
那么你并没有说明你是如何build立你的表格视图单元格的,但是如果它只是你的表格视图中的文本,它可以像下面这样简单:
 // provided you actually have your table view cell NSString *copyStringverse = yourSelectedOrClickedTableViewCell.textLabel.text; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyStringverse]; 
 [UIPasteboard generalPasteboard].string = @"Copy me!"; 
对于Swift 2.1+:
 let cell = tableView.cellForRowAtIndexPath(indexPath) as! UITableViewCell // change this to your custom cell if you use one UIPasteboard.generalPasteboard().string = cell.textLabel.text 
对于Swift 3.x
 UIPasteboard.general.string = "String to copy" 
对于Swift2.2
 UIPasteboard.generalPasteboard().string = tableViewCell.textLabel.text 
 通过使用这个,你可以直接设置UIPasteboard的值。