在下面写的NSData是代码:无法文件夹
NSData * imageData = [NSData dataWithContentsOfURL:imageURL];
[imageData writeToFile:savedImagePath options:NSDataWritingAtomic error:&error];
if(error != nil)
NSLog(@"write error %@", error);
错误:
write error Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)" UserInfo=0x8b7b850 {NSUnderlyingError=0x8b7d7c0 "The operation couldn’t be completed. No such file or directory", NSFilePath=/Users/alfa-1/Library/Application Support/iPhone Simulator/6.0/Applications/C24B228A-599E-4249-97A7-17775E8A546B/Library/Caches/ChannelListImages/http:/direct.domain.com/files/icons/1-all-cb.jpg, NSUserStringVariant=Folder}
也许你需要创建中间文件夹... – apascual 2013-02-21 12:43:24
显示的NSLog你savedImagePath。路径可能无效 – 2013-02-21 12:44:10
什么是中间文件夹?如果路径是/ folderA/folderB/folderC,则为 – 2013-02-21 12:44:15