iAsmi iAsmi - 5 months ago 12
HTML Question

How to show an UILable value/text value to HTML string in iOS?

I've one issue , I want to show html text in iOS , but I'm getting showing value in one label, how would I shown it in html text? here is what I did

_name.text = tutorial.title;

in _name.text I get the value from html parsing.

using this I'm showing html text, but how I pass _name.text value in this?

NSString *my=[NSString stringWithFormat:@"<html> <body> <p align='center'> <font color='red' size='3'> <strong> <u> hiii </p> </u> </srong> </font> </body> </html>"];


Using this I'm able to show hii or any one message using html but how I add parsing value in this?

Answer
 //setting text on label
[self.lblStatus setText:@"This is test data"];

//creating string with html format and adding label value in it
NSString *my=[NSString stringWithFormat:@"<html> <body> <p align='center'> <font color='red' size='3'> <strong> <u> %@ </p> </u> </srong> </font> </body> </html>",self.lblStatus.text];

//here i'm printing string, you can load it in webview
NSLog(@"My HTml String : %@",my);