ios - Using NSOutputStream outputStreamWithURL with a custom URLprotocol -
i'm writing custom url protocol (subclass of nsurlprotocol) deal local files need special way of reading , writing. no problem when reading: can create url -for example- "my-funny-file-protocol://...." , things work fine.
the problem arises when try write kind of url's. in particular, need use nsoutputstream, need call like:
nsstring *urlstring = [nsstring stringwithformat:@"my-funny-file-protocol://%@", path]; nsurl *url = [nsurl urlwithstring:urlstring]; nsoutputstream *writer = [nsoutputstream outputstreamwithurl:url append:no];
no exception raises, no logs on console result nil
. same file works, if use standard file:
protocol:
nsstring *urlstring = [nsstring stringwithformat:@"file://%@", path];
why? in fact nsurlprotocol documentation not explain case. perhaps i'm missing someting in urlprotocol implementation... what?
many in advance,
rob
Comments
Post a Comment