Hi, I wanted to set a hyperlink on UILabel in my iPhone application. Can anyone suggest me how to do it? Thanks.
Hi, instead of creating a hyperlink on UILable ..you can do it in UITextView or UIWebView that is very easy. See the below given code.
Creating a hyperlink in UITextView
UITextView *iView = [[UITextView alloc] initWithFrame: frame]; iView.text = @"this is http://www.roseindia.net link"; iView.editable = NO; iView.dataDetectorTypes = UIDataDetectorTypeLink; //cell is the TableView's cell [cell.contentView addSubview:iView]; [iView release];
Creating a Hyperlink in UIWebView
[iWebView loadHTMLString:@"<html><head></head><body style=\"font-family: sans-serif;\"> .... </body></html>" baseURL:nil];
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.