Subclassing NSInputStream
BJ Homer (via Dave DeLong):
-[NSInputStream _scheduleInCFRunLoop:forMode:]is the equivalent ofCFReadStreamScheduleWithRunLoopfor your stream. Do whatever you need to do so that you can give properkCFStreamEventHasBytesAvailablenotifications (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 implementingCFReadStreamScheduleWithRunLoopfor your stream.