iOS Zip檔案解壓
//zip檔案解壓 資料請求回來拿到 data 使用的解壓類別庫 SSZipArchive
NSString *path;
NSString *zipPath;
NSArray *pathes =NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES);
//解壓過后的存盤路徑
path= [pathes objectAtIndex:0];
//壓縮檔案存盤的本地路徑
zipPath= [path stringByAppendingPathComponent:@"temp.zip"];
[data writeToFile:zipPath options:0 error:nil];
[SSZipArchive unzipFileAtPath:zipPath toDestination:path];
NSString *htmlpath = [path stringByAppendingPathComponent:@"test.html"];
//轉為String
NSString *template = [NSString stringWithContentsOfFile:htmlpath encoding:NSUTF8StringEncoding error:nil];
NSLog(@"%@", template);
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/186478.html
標籤:其他
下一篇:【求】高幀率紅外資料集
