Subclassing NSInputStream
BJ Homer (via Dave DeLong):
-[NSInputStream _scheduleInCFRunLoop:forMode:]
is the equivalent ofCFReadStreamScheduleWithRunLoop
for your stream. Do whatever you need to do so that you can give properkCFStreamEventHasBytesAvailable
notifications (and any other notifications requested) at the proper time. That may involve scheduling a timer on the run loop, or if your subclass is just wrapping a vanilla NSInputStream, simply scheduling that stream on the run loop. Implement this method as if you were implementingCFReadStreamScheduleWithRunLoop
for your stream.