unzOpen()函數給出了錯誤「水溼打開」打開在一個zip文件,客觀拉鍊庫閱讀Zip文件給出了objectice-ZIP庫中的錯誤在iphone
我嘗試以下時間: - 其中,路徑爲壓縮文件的有效路徑具有讀/寫過量
(ID)initWithFileName:(的NSString *)文件名模式:(ZipFileMode)模式 { 如果(個體= [超級INIT] ) { _fileName = [fileName retain]; _mode = mode;
switch (mode) { case ZipFileModeUnzip: _unzFile = unzOpen((const char*)[_fileName UTF8String]); if (_unzFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; } break; case ZipFileModeCreate: _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE); if (_zipFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; } break; case ZipFileModeAppend: _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP); if (_zipFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; } break; default: { NSString *reason= [NSString stringWithFormat:@"Unknown mode %d", _mode]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; } }
}
迴歸自我; }
提示錯誤水溼打開文件 任何可以幫助請在此先感謝
其中mode是ZipFileModeUnzip
感謝Reply.I已經檢查出壓縮文件被正確存檔我成功郵編及解壓縮該數據庫文件沒有程序 – Piyush
你得到與zip文件的問題? – Deeps
@Piyush你是如何解決它的? – Samidjo