Re: Parsing HTML
Re: Parsing HTML
- Subject: Re: Parsing HTML
- From: Douglas Davidson <email@hidden>
- Date: Thu, 27 Oct 2005 13:52:10 -0700
On Oct 27, 2005, at 1:32 PM, Jesus De Meyer wrote:
In my app, I need to parse certain HTML characters/codes. Now, in
the past (before Tiger) I was using initWithHTML and that worked
fine, but in Tiger it doesn't work. Now an Apple engineer told me
that since initWithHTML now uses WebKit, I cannot use that method
inside a delegate method of NSURLConnection.
The problem is, that everything my app has to do happens after
connectionDidFinishLoading.
Is there a way around this so that I can still parse HTML text.
Parsing it manually is not a pleasant task.
The obvious solution is to move the parsing code out of the delegate
method, so that it takes place at some other point in the run loop.
The crudest way to do this is with perform-after-delay, but there are
plenty of other mechanisms, depending on the structure of your
application--for example, making the parsing lazy so that it happens
when the information is needed rather than when the data becomes
available. If you can't do this, there are other solutions to
parsing HTML, depending on what you actually need to get out of it--
for example, NSXMLDocument can parse HTML, as can various third-party
libraries.
Douglas Davidson
_______________________________________________
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
References: | |
| >Parsing HTML (From: Jesus De Meyer <email@hidden>) |