Question

I'm making a document-based application, backed by an abstract file storage system. Sometimes the files come from the local system (file://), sometimes they come from FTP, sometimes they come from SFTP, or theoretically even some non-standard scheme.

For all the local files I've been initializing NSData from the URL of the file. Ideally I'd like this to work for URLs like sftp://server.tld:22/... too, but I'm unsure if NSURL provides support for providing custom I/O operations for shemes it doesn't handle out of the box.

Does anyone know if you can register I/O handlers for non-standard URL schemes?

Was it helpful?

Solution

Yes, you subclass NSURLProtocol.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top