The hint is that the NSXMLParser docs say:

Parameters
stream
The input stream. The content is incrementally loaded from the specified stream 
and parsed.

if (*ra4 != 0xffc78948) { return false; }

On 8 Aug 2011, at 17:59, Mikkel Islay wrote:

> Thanks for the explanation, Jens too.
> The hint that NSXMLParser has that behaviour is that it accepts an 
> NSInputStream, or that it relies on a delegate for communicating 
> "parse-events"?
> 
> Mikkel
> 
> 
> On 8 Aug 2011, at 10:34, Andreas Grosam wrote:
> 
>> No. Asynchronous routines can be implemented above a blocking interface. 
>> Blocking and asynchronous interfaces work well together, and you may not 
>> even notice the existence of a blocking interface since it is working under 
>> the hood as an implementation detail.
>> 
>> For instance the parser *could* (we don't know) be implemented as a 
>> "recursive decent" parser. This kind of parser will effectively require that 
>> the parsing routine blocks, when there is no further input available, since 
>> the state of the parser will be in its call stack. So you can't just stop 
>> and exit the parse function in the middle of a stream, and then continue 
>> with a newly invoked method when more data is available. 
>> 
>> The parser would just dispatch its events on the main thread where the 
>> delegate can handle them. So, from the view point of the delegate, it looks 
>> like an asynchronous interface.
>> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/tom.davie%40gmail.com
> 
> This email sent to tom.da...@gmail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to