我正在尝试获取要下载的组件URL列表.我正在使用NSURLConnection来获取具有此URL列表的JSON文件.在
- (void)connection:(NSURLConnection *)connection didWriteData:(long long)bytesWritten totalBytesWritten:(long long)totalBytesWritten
Run Code Online (Sandbox Code Playgroud)
我写的总字节数是122239.什么时候
- (void)connectionDidFinishDownloading:(NSURLConnection *)connection destinationURL:(NSURL *)destinationURL
Run Code Online (Sandbox Code Playgroud)
我正在尝试读取url数据以提取JSON文件:
NSData *data = [NSData dataWithContentsOfURL:destinationURL options:NSDataReadingUncached error:&error];
Run Code Online (Sandbox Code Playgroud)
数据总是给我一个零值也有122239字节写在这个文件中,错误打印说明显示"没有这样的文件或目录"
Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn\u2019t be completed. (Cocoa error 260.)" UserInfo=0x4a1b90 {NSFilePath=/private/var/mobile/Applications/CD8E4838-D78D-41DE-8896-360B7FC02A1D/tmp/c1749157e1d4317f6158a8490e138e7e, NSUnderlyingError=0x4c5ae0 "The operation couldn\u2019t be completed. No such file or directory"}
Run Code Online (Sandbox Code Playgroud)
有什么建议?