Friday, December 11, 2015

NSFileHandle’s Indeterminable readabilityHandler

Sven (via Jeremy W. Sherman):

The problem is that I need to know when the last chunk of data was read. availableData should return an empty NSData instance if it reached end-of-file, but the problem is that the reachability handler is not called again on EOF.

I can’t find anything about how to get some kind of notification or callback on EOF. So what am I missing? Is Apple really providing an asynchronous reading API without an EOF callback?

Comments RSS · Twitter

Leave a Comment