• 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
NSAttributedString - initWithURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAttributedString - initWithURL


  • Subject: NSAttributedString - initWithURL
  • From: Sebastian Frey <email@hidden>
  • Date: Tue, 21 May 2002 18:27:53 -0700

Hey all -

OK, I'm a total newbie (talkin' 2-3 days), standard disclaimers apply.

So here I am, playing around, and I want to have a little app that
fetches a web page and renders the HTML, as best it can using the native
Cocoa stuff. From what I gather, I need to get a NSAttributedString and
use that in a NSTextView.

I am trying to load up the NSAttributedString using initWithURL:
documentAttributes: like so

attrString = [[NSAttributedString alloc] initWithURL:theURL
documentAttributes: (NSDictionary **) NULL];

The problem is that attrString always gets set to nil. No surprise,
because the docs say: "Returns self, or nil if the file at path can't
be decoded."

However, I don't know why the file at the path can't be decoded. I have
been able to get the data from the file at the URL easily enough like
this:

aString = [NSString stringWithContentsOfURL:theURL];

Using the very same URL.

Thanks in advance,

-Sebastian
_______________________________________________
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: NSAttributedString - initWithURL
      • From: Scott Anguish <email@hidden>
    • Re: NSAttributedString - initWithURL
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: dataWithPDFInsideRect subviews don't clip
  • Next by Date: re:Build Log
  • Previous by thread: dataWithPDFInsideRect subviews don't clip
  • Next by thread: Re: NSAttributedString - initWithURL
  • Index(es):
    • Date
    • Thread