title: Remove Html Format from String
body: <p>I have been trying to format a string in my text view but I cant work it out. Im very new to xcode.</p>
  
  <p>Am i missing something in this file? I have been looking through stack and this is how you do it..but its not working.</p>
  
  <p><img src="https://i.stack.imgur.com/pk0x6.png" alt="enter image description here"></p>
  
  <pre><code>- (NSString *)stripTags:(NSString *)str
  {
      NSMutableString *html = [NSMutableString stringWithCapacity:[str length]];
  
      NSScanner *scanner = [NSScanner scannerWithString:str];
      scanner.charactersToBeSkipped = NULL;
      NSString *tempText = nil;
  
      while (![scanner isAtEnd])
      {
          [scanner scanUpToString:@"&lt;" intoString:&amp;tempText];
  
          if (tempText != nil)
              [html appendString:tempText];
  
          [scanner scanUpToString:@"&gt;" intoString:NULL];
  
          if (![scanner isAtEnd])
              [scanner setScanLocation:[scanner scanLocation] + 1];
  
          tempText = nil;
      }
  
      return html;
  }
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      NSString *str = newsArticle;
  
      descTextView.text = [NSString stringWithString:str];
  
  
      // Do any additional setup after loading the view from its nib.
  }
  </code></pre>