0

使用objective-zip,我尝试打开一个加密的zip文件,但导致程序崩溃

如何解决这个问题?

readStream= [[MyZip sharedInstance] readCurrentFileInZip];//open zip

for (FileInZipInfo *info in [MyReadStream sharedInstance ]) {
    if([info.name isEqualToString:filePath]){
        data= [readStream readDataOfLength:info.length];
    }                    

readStream= [[MyZip sharedInstance] readCurrentFileInZipWithPassword:@"111111"];//not open zip

for (FileInZipInfo *info in [MyReadStream sharedInstance ]) {
    if([info.name isEqualToString:filePath]){
        data= [readStream readDataOfLength:info.length];
    }                

崩溃日志是

2013-04-30 09:18:17.284 CACHED: pmobile/index.html
2013-04-30 09:18:17.292  *** Terminating app due to uncaught exception 'ZipException', reason: 'Error in opening current file in '/var/mobile/Applications/023BD245-95F2-4EBB-802B-3455B998D55D/MobileBank-GuangNongXin.app/LocalFiles/pmobile.zip''
*** First throw call stack:
(0x39f152a3 0x33e0497f 0xf391d 0xeb8dd 0x34c98539 0x34c8fdb9 0x34d36859 0x34d36e5f 0x34d375c1 0x34d381ed 0x37a4fe75 0x37a6818f 0x37a66b2d 0x37a8c133 0x39e5b74d 0x37a8c593 0x379f015d 0x39eea683 0x39ee9ee9 0x39ee8cb7 0x39e5bebd 0x39e5bd49 0x35bd5f6f 0x375fcfab 0x34f7c311 0x34f7c1d8)
libc++abi.dylib: terminate called throwing an exception

我想读取pmobile/index.htmlzip包中的文件,如果zip是加密的会出现崩溃信息,但是如果zip没有加密,运行正常。

4

0 回答 0