how to create a hyperlink for the NSString variable
I am new to iPhone developemnt.
NSString myUrl = @"www.google.com";
I need to know how to create a hyperlink for the above NSString variable.
In the MFMailComposeViewController
I need to use like below
[mailViewController setMessageBody:myUrl isHTML:YES];
Please help me out.
开发者_StackOverflowThanks for any help.
The easiest way is to make the UILabel
into a UIButton
, style it (use Custom type to get rid of button look). Then connect to an Action that opens safari.
The action should do this:
NSURL *url = [[[ NSURL alloc ] initWithString: @"http://www.example.com" ] autorelease];
[[UIApplication sharedApplication] openURL:url];
精彩评论