Re: CFStream and Cocoa stream
Re: CFStream and Cocoa stream
- Subject: Re: CFStream and Cocoa stream
- From: Prachi Gauriar <email@hidden>
- Date: Mon, 21 Jun 2004 13:49:02 -0500
On Jun 21, 2004, at 12:34 PM, Jesus De Meyer wrote:
Hi,
I was wondering if it's possible to create an NSInputStream or
NSOutputStream from a CFStream function, like for example
CFReadStreamCreateWithFTPURL();
I ask because I wanna experiment with FTP functions in CF but I wanna
use the Cocoa classes of NSInputStream and NSOutputStream. Is this
even possible?
According to the docs:
NSStream is built on the CFStream layer of Core Foundation. This close
relationship means that the concrete subclasses of NSStream,
NSOutputStream and NSInputStream, are toll-free bridged with their Core
Foundation counterparts CFWriteStream and CFReadStream. Although there
are strong similarities between the Cocoa and Core Foundation stream
APIs, their implementations are not exactly coincident. The Cocoa
stream classes use the delegation model for asynchronous behavior
(assuming run-loop scheduling) while Core Foundation uses client
callbacks. The Core Foundation stream types sets the client (termed a
context in Core Foundation) differently than the NSStream sets the
delegate; calls to set the delegate should not be mixed with calls to
set the context. Otherwise you can freely intermix calls from the two
APIs in your code.
In other words... yes.
-Prachi
_______________________________________________
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.