Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How to assign HTML tag string format to strin directly , so that i can display it in UiWEB VIEW directly .

 <tr>
      <td align="center"><b>    Disclaimer</b></td>
   </tr>
     <tr>
       <td colspan="2" style="text-align:justify" class="ImageBorder">

   <p>

Personal Trainer is an endeavor by Bhasinsoft to provide in depth details and knowledge on exercises and workout regimes to work towards a health and fit body. While great care has been taken to provide as accurate knowledge and details as possible by referring to knowledge in public domain, guidance by fitness specialists and doctors, Bhasinsoft is not responsible for the accuracy of the data.

The data is provided AS IS and you understand that Bhasinsoft is not responsible for the accuracy, usefulness or safety resulting from the use of the content. You further understand and acknowledge that you may be exposed to content that is inaccurate, offensive, indecent, or objectionable, and you agree to waive, and hereby do waive, any legal or equitable rights or remedies you have or may have against Bhasinsoft with respect thereto, and, to the extent permitted by applicable law, agree to indemnify and hold harmless Bhasinsoft, its owners, operators, affiliates, licensors, and licensees to the fullest extent allowed by law regarding all matters related to your use of the content.

YOU AGREE THAT YOUR USE OF THE CONTENT SHALL BE AT YOUR SOLE RISK. TO THE FULLEST EXTENT PERMITTED BY LAW, BHASINSOFT, ITS OFFICERS, DIRECTORS, EMPLOYEES, AND AGENTS EXCLUDE ALL WARRANTIES, EXPRESS OR IMPLIED, IN CONNECTION WITH THE SERVICES AND YOUR USE THEREOF. TO THE FULLEST EXTENT PERMITTED BY LAW, BHASINSOFT EXCLUDES ALL WARRANTIES, CONDITIONS, TERMS OR REPRESENTATIONS ABOUT THE ACCURACY OR COMPLETENESS OF THIS CONTENT AND ASSUMES NO LIABILITY OR RESPONSIBILITY FOR ANY (I) ERRORS, MISTAKES, OR INACCURACIES OF CONTENT, (II) PERSONAL INJURY OR PROPERTY DAMAGE, OF ANY NATURE WHATSOEVER, RESULTING FROM YOUR ACCESS TO AND USE OF OUR SERVICES OR THE CONTENT, AND/OR (III) ANY ERRORS OR OMISSIONS IN ANY CONTENT OR FOR ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF THE USE OF ANY CONTENT. BHASINSOFT DOES NOT WARRANT, ENDORSE, GUARANTEE, OR ASSUME RESPONSIBILITY FOR ANY PRODUCT OR SERVICE ADVERTISED OR OFFERED BY A THIRD PARTY THROUGH THE SERVICES OR ANY HYPERLINKED SERVICES OR FEATURED IN ANY BANNER OR OTHER ADVERTISING, AND BHASINSOFT WILL NOT BE A PARTY TO OR IN ANY WAY BE RESPONSIBLE FOR MONITORING ANY TRANSACTION BETWEEN YOU AND THIRD-PARTY PROVIDERS OF PRODUCTS OR SERVICES. AS WITH THE PURCHASE OF A PRODUCT OR SERVICE THROUGH ANY MEDIUM OR IN ANY ENVIRONMENT, YOU SHOULD USE YOUR BEST JUDGMENT AND EXERCISE CAUTION WHERE APPROPRIATE.

so i can easily dispaly it in same formatt its present with this metho

 self.webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 14 , 320, 343)];

NSString *tttt=[NSString stringWithString:@" <tr> <td align="center"><b>Disclaimer</b></td></tr> ";

[  self.webView loadHTMLString:self.app.musclesl baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
[self.secondView addSubview:self.webView];
share|improve this question
1  
I'm unclear on what you've actually attempted which isn't working? A bit heavy on the disclaimer spam too. – Mal Apr 9 at 3:42
just tell me how to assign the html tagged st5ring to naastrin hard coded please – user2256034 Apr 9 at 3:50

2 Answers

up vote 1 down vote accepted

Do like,

NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
NSString *pathToHtml = @"html";
NSURL *baseURL = [[NSURL alloc] initFileURLWithPath:pathToHtml isDirectory:YES];

NSString *html = [NSString stringWithContentsOfFile:[[NSBundle mainBundle]    
                             pathForResource:@"nameOfFile" ofType:@"html"                                                               
                             inDirectory:@"html"] 
                         encoding:NSUTF8StringEncoding error:nil];
[webview loadHTMLString:html baseURL:baseURL];

It will be work...

share|improve this answer
its workin ,but how this text fit in the given width automatically, its should be fitted in the screen,same formatt text but fited to screen, no width scroll needed .please guie – user2256034 Apr 9 at 5:39
you may try the link stackoverflow.com/questions/10666484/… – developer.mono Apr 9 at 6:44

I think the loadHTMLString() should work,

[self.webView loadHTMLString:tttt];
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.