Re: Tiger: NSAttributedString from WebArchive
Re: Tiger: NSAttributedString from WebArchive
- Subject: Re: Tiger: NSAttributedString from WebArchive
- From: Nicko van Someren <email@hidden>
- Date: Tue, 10 May 2005 16:03:01 +0100
On 9 May 2005, at 17:11, Pierre Bernard wrote:
Isn't this supposed to work?
...
// Set up the options dictionary with desired parameters
[options setObject:url forKey:NSBaseURLDocumentOption];
[attributedString readFromData:data options:options
documentAttributes:&docAttrs];
...
In fact it takes minutes - like it is waiting on some network timeout.
Only to produce an empty string.
Have you tries adding:
[options setObject: NSWebArchiveTextDocumentType forKey:
NSDocumentTypeDocumentAttribute]
so that it knows what sort of data it is supposed to unpack? I've
not tried this but it might work.
Alternatively, the web archive format is just a binary plist so you
could use NSDictionary +dictionaryWithContentsOfFile: to unpack the
raw data and fetch the HTML as an NSData from the key
WebMainResource, subkey WebResourceData.
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden