d11wtq
d11wtq

Reputation: 35318

NSURL with a custom scheme?

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?

Upvotes: 2

Views: 846

Answers (1)

Mike Abdullah
Mike Abdullah

Reputation: 15003

Yes, you subclass NSURLProtocol.

Upvotes: 3

Related Questions