如何使用Objective-Zip检测ZipException?

时间:2014-10-27 19:46:05

标签: ios objective-c objectivezip

我使用来自github的Objective-Zip - https://github.com/flyingdolphinstudio/Objective-Zip 如果zip文件坏了我有这个:

Terminating app due to uncaught exception 'ZipException', reason: 'Can't open

之后app崩溃了。 如何得到错误,但程序没有下降?

1 个答案:

答案 0 :(得分:1)

简单地抓住例外:

@try {
    // Zip code here
}
@catch (ZipException *exception) {
    // Error happened, do whatever you need
}