I need to upload large files as MIME multipart bodies. So I wrote a custom NSInputStream subclass (TDMultipartStreamer) that reads the files incrementally and intersperses the MIME boundary strings between them. Then I set such a stream as the HTTPBodyStream of an NSMutableURLRequest and start the connection.
Unfortunately this very soon raises an exception (q.v.). It looks like CFNetwork is expecting my stream subclass to implement an undocumented private method _scheduleInCFRunLoop:forMode:. That seems wrong, since the API allows me to use any valid NSInputStream.
#0 0x00007fff94e77d45 in objc_exception_throw ()
#1 0x00007fff93fc62ae in -[NSObject doesNotRecognizeSelector:] ()
#2 0x00007fff93f26e73 in ___forwarding___ ()
#3 0x00007fff93f26c88 in __forwarding_prep_0___ ()
#4 0x00007fff93ef1ee6 in CFReadStreamScheduleWithRunLoop ()
#5 0x00007fff943f8b56 in spoolingSchedule ()
#6 0x00007fff93ef2b56 in _CFStreamScheduleWithRunLoop ()
#7 0x00007fff93ef2b56 in _CFStreamScheduleWithRunLoop ()
#8 0x00007fff93ea84c2 in __CFSetApplyFunction_block_invoke_1 ()
#9 0x00007fff93ea8311 in CFBasicHashApply ()
#10 0x00007fff93ea8294 in CFSetApplyFunction ()
#11 0x00007fff95e63d67 in HTTPProtocol::openStream ()
#12 0x00007fff95e62d49 in HTTPProtocol::useNetConnectionForRequest ()
#13 0x00007fff95e62946 in HTTPConnectionCacheEntry::dispatchConnectionToProtocol ()
#14 0x00007fff95e5e0c1 in HTTPConnectionCacheEntry::enqueueRequestForProtocol ()
#15 0x00007fff95e5d901 in HTTPConnectionCache::EnqueueRequestForProtocol ()
#16 0x00007fff95e5a283 in HTTPProtocol::createStream ()
#17 0x00007fff95e59b82 in HTTPProtocol::createAndOpenStream ()
#18 0x00007fff95e57ef1 in URLConnectionLoader::loaderScheduleOriginLoadLocked ()
#19 0x00007fff95f29c12 in URLConnectionLoader::loaderScheduleOriginLoad ()
#20 0x00007fff95f29637 in URLConnectionLoader::LoaderConnectionEventQueue::processAllEventsAndConsumePayload ()
#21 0x00007fff95e57959 in URLConnectionLoader::processEvents ()
#22 0x00007fff95e529ee in MultiplexerSource::perform ()
#23 0x00007fff93ea86e1 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#24 0x00007fff93ea7f4d in __CFRunLoopDoSources0 ()
#25 0x00007fff93eced39 in __CFRunLoopRun ()
#26 0x00007fff93ece676 in CFRunLoopRunSpecific ()
#27 0x00007fff942aaffb in +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] ()
#28 0x00007fff9429f74e in -[NSThread main] ()
#29 0x00007fff9429f6c6 in __NSThread__main__ ()
#30 0x00007fff97c1d8bf in _pthread_start ()
#31 0x00007fff97c20b75 in thread_start ()