Question

I am using RichTextEditor exactly as detailed in this link and I need to show the written content in table view in other class on a button click, but in the table view cell, corresponding html string is appearing. Following is my code

-(void)submitClicked{
  contentObject.webCOntent=webView;
            contentObject.savedMessage=SAVED;
            contentObject.str = [webView stringByEvaluatingJavaScriptFromString: 
                         @"document.body.innerHTML"];
            NSLog(@"created  %@",contentObject.str);
}

in tableView cellforRowAyIndexPath,

cell.textLabel.text = [[notesArray objectAtIndex:indexPath.row]str ];

When I run the app,its Showing in tableview Oiuo8 

where, contentObject is modelclass object and str is string and webcontent is UIWebView in model class

Was it helpful?

Solution

I got the solution finally by changing contentObject.str = [webView stringByEvaluatingJavaScriptFromString: @"document.body.innerHTML"]; to contentObject.str = [webView stringByEvaluatingJavaScriptFromString: @"document.documentElement.textContent"];,its giving the normal text instead of html text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top