2014-10-27 25 views
-1

我使用的Objective-郵編從GitHub - https://github.com/flyingdolphinstudio/Objective-Zip 如果zip文件打破我有這樣的:後如何用Objective-Zip檢測ZipException?

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

和應用程序崩潰。 如何獲得錯誤,但程序沒有下降?

+0

捕獲異常? – 2014-10-27 21:05:43

+0

如果文件損壞,我需要不會崩潰應用程序,並顯示alertview該文件已損壞 – DimonDeveloper 2014-10-27 21:13:50

+0

那麼,您可以訪問源代碼。修改它以按照你想要的方式處理錯誤。 – 2014-10-27 21:25:08

回答

1

簡單地捕捉到了異常:

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