views:

366

answers:

1

I placed a UITextField and a UITextView in a tableviewcell. When tap on text in them, it allows me to enclose a portion of the text with a rectangular popup showing the enclosed text enlarged. I want to either copy or paste over the selected text, but the copy-paste menu never show up whether I single tap, double taps or press and hold. I appreciate any hints you can give.

A: 

Somehow the copy/paste menu starts showing up when I tap the textfield or textview. Not clear on what I have done that made the difference. But I can tell you what I did for your reference. I tried to married NIB file, Custome UIViewController, UITableViewCell into one. I had the textfield and textview embeded in a UIViewController. The UIViewController userinterface is loaded from a NIB file. I then have the UIViewController view added as a subview into the tableViewCell. You can do some googling on this. There are many suggestions.

I do agree with some people who advice not to load NIB into an UITableViewCell. In the end, I took the advice and coded the user interface entirely without the NIB file. I declared a subclass of UITableViewCell then had thd user interface constructed within the initWithStyle. This way the custom tableViewCell was readily useful in the tableView without the headache of figuring out how to load the NIB file and how to make the UIViewController reuseable as a tableViewCell.

Since the code was a lot cleaner, I probably accidentally removed the bad code that had broke the copy/paste mechanism.

Wayne Lo