UITextField *tf = [UITextFiled alloc] init];
[[tf valueForKey:@"textInputTraits"] setValue:[UIColorclearColor]
forKey:@"insertionPointColor"];
[tf selectAll:self];
[tf setMarkedText:sender.text
selectedRange:NSMakeRange(0, 0)];
iOS开发时,UITextFiled在点击后选择文本,布布扣,bubuko.com
原文:http://www.cnblogs.com/tyrant2012/p/3607963.html