• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
TextView from HTML with embedded images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TextView from HTML with embedded images


  • Subject: TextView from HTML with embedded images
  • From: David Sinclair <email@hidden>
  • Date: Sun, 22 Sep 2002 23:32:38 -0700

I couldn't find an answer to this in the documentation and archives, so here goes:

I'm loading a HTML page into a TextView. The page includes some images using relative URLs, some with absolute. The absolute URL images load and display fine, but the relative ones don't load.

Can anyone help me make the relative ones work, or is it not possible?

Here's my code, if it helps:


NSURL *pageURL = [NSURL URLWithString:pageString];
NSData *data = [NSData dataWithContentsOfURL:pageURL];

NSAttributedString *bodyAttrString = [[[NSAttributedString alloc] initWithHTML:data documentAttributes:nil] autorelease];

[[bottomText textStorage] replaceCharactersInRange:NSMakeRange(0,[[[bottomText textStorage] string] length]) withAttributedString:bodyAttrString];

--

David Sinclair - email@hidden
http://www.dejal.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: TextView from HTML with embedded images
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Problem killing my threads :)
  • Next by Date: Re: TextView from HTML with embedded images
  • Previous by thread: Re: Problem killing my threads :)
  • Next by thread: Re: TextView from HTML with embedded images
  • Index(es):
    • Date
    • Thread