iOS7 UITextView set NSLinkAttributeName attribute but can not click
问题 @interface ViewController ()<UITextViewDelegate> - (void)viewDidLoad { [super viewDidLoad]; NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"www.google.com"]; NSDictionary *linkDic = @{ NSLinkAttributeName : [NSURL URLWithString:@"http://www.google.com"] }; [str setAttributes:linkDic range:[[str string] rangeOfString:@"www.google.com"]]; _textView.attributedText = str; } - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange: