0

In one project XCode4 intellisence feature shows setContentToHTMLString method of UITextView but in other project intellisence feature not showing setContentToHTMLString this method of UITextView.

I want to use setContentToHTMLString method of UITextView for HTML-based Presentation-only in my textView this works in one Project but not showing even by the intellisence feature of UITextView.

Any Suggestion.

Thanks in Advance....

Nitish
  • 13,845
  • 28
  • 135
  • 263
user755278
  • 1,634
  • 3
  • 16
  • 32
  • check weather the project which has setContentToHtmlString of textview method is customized textview or default textview provided in the xcode. – Aman Aggarwal May 26 '11 at 09:12
  • I'm new to iphone how can we find that either this is customize textView or not because I m unable to find any thing new in this accept this @interface UITextView (extended) - (void)setContentToHTMLString:(NSString *) contentText; this program used this interface in .m file @end – user755278 May 26 '11 at 09:23
  • The answer given below is right.You can use the code from the link provided by sergio i.e. it is in private API . Hope it helps you...... – Aman Aggarwal May 26 '11 at 09:35
  • Ya Aman it works for me but using this apple reject my app. because of using Private Api. Can you give me suggestion if bcoz i'm received html tags after parsing the url if we display on the webView to it works normally. How can i display data on webView after parsing for displaying on the textView i used self.textView.text = [self.textView.text stringByAppendingFormat:@"%@\n\n",capturedCharacters]; can u tell he how can i display on webView thanks... – user755278 May 26 '11 at 09:48

1 Answers1

0

I don't know why Xcode has this changing behavior, but I would suggest you not to use that method, because it is in a private API, so your app would be rejected by Apple. Possibly the fact that it is private is also why sometimes it is showing (it should not), others it is not.

The way to go to display HTML content is either use a [UIWebView][2], with all its caveats, or try out Three20 styled text facilities, which are quite limited, though.

Community
  • 1
  • 1
sergio
  • 68,819
  • 11
  • 102
  • 123
  • if we put parsed data directly to UIWebView then html tags are works normally or not. – user755278 May 26 '11 at 09:54
  • UIWebView will render your HTML almost exactly like Safari would do, including CSS, Javascript and everything. Use the `-loadHTMLString:baseURL:` method. – sergio May 26 '11 at 09:56